-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add graphql.schemaPath configuration #8773
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit cdb9427:
|
@marekryb this is awesome! For We are actually already looking similar breaking changes for this in #8765 |
@dcousens Okay. I removed I looked briefly at recent PRs and see no problem. 268d703 removes meta from sudo() which is fine. This PR goes further and removes it also from the final client schema. I am confused though about what is happening in the repo. Eg. PR #8767 which was supposedly merged to main in a04d66d, but it says |
Fair question! I think we might want to switch to a different git workflow when we're doing majors in the future. |
@marekryb thinking about this, for future version updates, we'll endeavor to merge pull requests to a separate branch that will be rebase merged with This should set us up for a minimal amount of git work while leveraging the same pull request workflows we use now. |
@dcousens Ok, thank you for explaining. Separate branch seems more natural indeed. |
3302f98
to
f64d0fc
Compare
@marekryb we have removed any references to the We will ensure to add your name as the following on the merge and commit messages for that upcoming pull request (and this), as we will be using your commits and idea 💛
(this is derived from the authorship information you put in your commits) |
f64d0fc
to
47b3787
Compare
Co-authored-by: Marek Rybczynski <[email protected]>
47b3787
to
7f186ea
Compare
This pull requests adds two new configuration options:
graphql.schemaPath
Allows you to define path of generated GraphQL schema (default:
schema.graphql
)Motivation:
Quite commonly I create custom mutations through
extendGraphqlSchema
because I need to use transaction over multiple tables and/or increment/decrement counter. In these situations, I would like to completely disable some operations throughgraphql: { omit: { create: true, update: true } }
on these lists, but for sake of having Admin UI working, I cannot do this. This sometimes causes confusion among fellow developer(s) or a 3rd party as they start using some mutations that are not intended to be ever used and later they have to change it over.In all recent projects I am using keystone as a route in nextjs (as in examples/framework-nextjs-*-directory) so I do not need Admin UI in production. In development however, Admin UI is commonly preferred over direct database access. So what I actually need is to have two GraphQL schemas: one used inside nextjs (no AdminUI) and one for standalone server (with AdminUI).
-graphql.excludeKeystoneMeta
Allows you to exclude
keystone: KeystoneMeta!
query from the GraphQL API that is used by the Admin UI.This is seems reasonable in cases where AdminUI is disabled (either through
ui.isDisabled: true
or because using it within framework like nextjs). Initially I was thinking to useui.isDisabled
as a condition for dropping the query rather than new config option, but this would be breaking change with no way to opt-out.