-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Allow querying in REST API and GraphQL #995
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Addresses: #888 # Allow querying in REST API and GraphQL Allows `PARTIAL` and `EXACT` match querying ## REST API query demo https://user-images.githubusercontent.com/35935196/180443733-61e75634-5f86-4777-a21f-7959a5cff734.mov ## GQL API query demo https://user-images.githubusercontent.com/35935196/180443718-721d97c9-f2ab-418e-af7f-23c3c5faa66e.mov ## Sample queries ### GraphQL ``` gql { apiNamespaces(slug: "support_request") { id apiResources(properties: { product:{ option: "PARTIAL", value: "nikean" } }) { id properties } } } ``` <img width="1728" alt="Screen Shot 2022-07-31 at 1 29 46 PM" src="https://user-images.githubusercontent.com/35935196/182038364-d10d51d3-e5ff-46a1-84ec-443aa862b7ea.png"> Co-authored-by: Pralish Kayastha <[email protected]>
Acceptance Criteria:
|
|
donrestarone
added
Passing UAT on Staging ✅
not generally available - deployed to Restarone.Solutions
and removed
Pending UAT on Staging 🔴
labels
Jul 31, 2022
donrestarone
added a commit
that referenced
this pull request
Sep 15, 2022
Addresses: #267 guide for querying: #995 *need better docs* ## Demo https://user-images.githubusercontent.com/35935196/185770631-67a9aed9-bc09-47bd-b437-17e35cc824c6.mov ## Demo Sortable https://user-images.githubusercontent.com/50227291/188428768-00232faa-7fc0-4bf7-aae4-3e6714c171a8.mov ## HOW TO USE #### Api Resource Index - create snippet with identifier same as api_namespace slug - Variables available on snippet: @api_resources & @api_namespace - Render the snippet on any page with this helper: {{cms:helper render_api_namespace_resource_index 'identifier'}} - Is filterable using query params, eg: http://lvh.me:5250/?properties={"synced":"false"} #### Api Resource show - create snippet with identifier as api_namespace slug with '-show' at the end, eg: people-show - Variables available on snippet: @api_resource & @api_namespace - Render the snippet on any page with this helper: {{cms:helper render_api_namespace_resource 'identifier'}} - id query params is mandetory, will raise 404 otherwise. eg: http://lvh.me:5250/?id=123 ``` ruby {{ cms:helper api_namespace_resource_index 'slug', scope: { properties: { property: value } } }} ``` for sorting you can do something like: ``` ruby {{ cms:helper render_api_namespace_resource_index 'cars', scope: { properties: { published: 'true' }, order: { created_at: 'DESC' } } }} ```
donrestarone
added a commit
that referenced
this pull request
Sep 15, 2022
Addresses: #267 guide for querying: #995 *need better docs* ## Demo https://user-images.githubusercontent.com/35935196/185770631-67a9aed9-bc09-47bd-b437-17e35cc824c6.mov ## Demo Sortable https://user-images.githubusercontent.com/50227291/188428768-00232faa-7fc0-4bf7-aae4-3e6714c171a8.mov ## HOW TO USE #### Api Resource Index - create snippet with identifier same as api_namespace slug - Variables available on snippet: @api_resources & @api_namespace - Render the snippet on any page with this helper: {{cms:helper render_api_namespace_resource_index 'identifier'}} - Is filterable using query params, eg: http://lvh.me:5250/?properties={"synced":"false"} #### Api Resource show - create snippet with identifier as api_namespace slug with '-show' at the end, eg: people-show - Variables available on snippet: @api_resource & @api_namespace - Render the snippet on any page with this helper: {{cms:helper render_api_namespace_resource 'identifier'}} - id query params is mandetory, will raise 404 otherwise. eg: http://lvh.me:5250/?id=123 ``` ruby {{ cms:helper api_namespace_resource_index 'slug', scope: { properties: { property: value } } }} ``` for sorting you can do something like: ``` ruby {{ cms:helper render_api_namespace_resource_index 'cars', scope: { properties: { published: 'true' }, order: { created_at: 'DESC' } } }} ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses: #888
Allow querying in REST API and GraphQL
Allows
PARTIAL
andEXACT
match queryingREST API query demo
Screen.Recording.2022-07-22.at.2.22.50.PM.mov
GQL API query demo
Screen.Recording.2022-07-22.at.1.14.11.PM.mov
Sample queries
GraphQL
Co-authored-by: Pralish Kayastha [email protected]