-
Notifications
You must be signed in to change notification settings - Fork 653
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
Apollo 4 AST - add a flag to relax parsing and allow empty extend type
#6061
Comments
Hi 👋 Thanks for the detailed issue and reproducer! This actually "works as designed"... GraphQL lists are non-empty by default:
See also ObjectTypeExtension:
I'm not opposed to adding parsing options to relax the syntax if there's a clear use case. Ideally this is changed in the spec itself. There are a few other places where having empty lists could be useful. Latest to date from @StylianosGakis is empty selection sets if you just want to know if a composite object is null without selecting anything: query GetFoo {
# this is not valid GraphQL but could be useful to get the nullability of foo
foo {}
} |
Thanks for the explanation! The use case for us is that we have a local A workaround that seems to work is to add a |
@ychescale9 want to open an issue in the GraphQL spec repo so we have tracking for this use case? |
@martinbonnin I'm not sure if my terminologies are right so feel free to chime in 😄 Turned out there's an existing issue: graphql/graphql-spec#568 |
extend type
no longer allowedextend type
Version
4.0.0-rc.1
Summary
Prior to apollo 4 it's possible to have empty
extend type Query|Mutation
definitions:With Apollo 4, compiling the module with these empty type definitions (the module has both the
schema.graphqls
from remote and a localstub.graphqls
) fails with the following:Steps to reproduce the behavior
With Apollo 4, add a
stub.graphqls
file in a module:in
build.gradle.kts
:Run
./gradlew my-schema:generateMyServiceApolloCodegenSchema
.Logs
No response
The text was updated successfully, but these errors were encountered: