-
Notifications
You must be signed in to change notification settings - Fork 61
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
NEW: Field formatting API, forward compatibility #313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Tested this with all the branches mentioned in #282.
Talked with Aaron, we've agreed to mark the new API surface as @internal
and encourage usage of GraphQL v4 instead.
We'll want to merge this close to the time as all the other PRs, since it would break common dev usage such as silverstripe/cms:4.x-dev
+ silverstripe/graphql:3.x-dev
usage otherwise.
Moved from: #310
We need backward compat for all the core modules, so they can run on either v3 or v4. It's very difficult to do this at run time because the graphql queries are bound to components at build time, so having two separate queries is both a technical challenge and also hard to maintain.
The easier solution is to allow the graphql 3 queries to look like graphql 4 queries, and the main issue there is case sensitivity.
This pull request allows the optional provision of a field formatter function and field accessor service to abstract this away. By default, you still get the naive implementation of DBField == GraphQL Field, but in admin, we'll want to take advantage of a lowerCamelCase transform.
Todo: