-
Notifications
You must be signed in to change notification settings - Fork 468
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
SDK: Provide a client.getPage
method to fetch page, content, nav using graphQL
#30968
Comments
The name of the method implies that only support GQL, needs better naming. Add examples on how the method will be used, include basic and advanced examples. Make sure is defined here the params that accepts and the response expected. Also, what about error management? What about site overwrite? what about headers overwrite? This is the key part of this enhancement, needs to me on point. |
I 100% agree, we can discuss a new naming
I'll add along with the Based query we need in order to make the page work
agree
I'll revisit this and add the params we need to support. |
client.getPageAsset
method to fetch page, content, nav using graphQL
client.getPageAsset
method to fetch page, content, nav using graphQLclient. getPage
method to fetch page, content, nav using graphQL
client. getPage
method to fetch page, content, nav using graphQLclient.getPage
method to fetch page, content, nav using graphQL
This is the base query needed for the UVE to work.Note: You can find this and more in the POC core/core-web/libs/sdk/client/src/lib/client/gql/utils.ts Lines 8 to 62 in f074c88
|
Caution
THESE ARE BREAKING CHANGES AND SHOULD BE DOCUMENTED
Parent Issue
#30943
Overview of the Issue:
To enable a unified and flexible GraphQL querying system, we need to implement a method
client.getPage
that:page
,content
, andnav
, requiring at least one._map
fields in the response to remove them from the output while maintaining their parsed values.This method will be critical for both developers using the SDK and for internal UVE operations, ensuring consistent and optimized GraphQL usage.
POC:
#30814
Task
client.getPage
Method:page
,content
, andnav
queries.page
,content
, ornav
, is provided._map
fields from the GraphQL response._map
values in the output data structure.Proposed Objective
Technical User Experience
Proposed Priority
Priority 2 - Important
Acceptance Criteria
client.getPage
method correctly merges the base query with custom queries using GraphQL fragments.page
,content
, ornav
is provided._map
fields are parsed and removed from the response.{ pageAsset, content, nav, query }
.README.md
provides clear guidance for usage and integration.Sub-Tasks & Estimates
client.getPage
method.page
,content
, ornav
)._map
fields in the response.README.md
with usage examples and details.Use Cases
Simple Use Cases
Advance Use Cases
Error Handling:
Developer Note: Documentation for
getPageContent
MethodObjective: Ensure comprehensive documentation for the
getPageContent
method to clarify expected arguments and their purposes.Key Points to Document:
url
(String): The only required property. It specifies the URL of the page to be fetched.language
(String, Optional): Specifies the language in which the page content should be retrieved.pageFragment
(String, Optional): A query string to fetch specific fragments of the page, useful for modular content.content
(Object, Optional):content
object should correspond to a query that retrieves the desired data.nav
(Object, Optional):Purpose of
content
:The
content
argument is specifically designed to allow developers to fetch extra content that is not inherently part of the page's main structure. This enables the inclusion of dynamic or related content, enhancing the page's richness and user engagement.The text was updated successfully, but these errors were encountered: