-
Notifications
You must be signed in to change notification settings - Fork 1
fix: add graphql valid object annotation to all input and output types #45
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
Conversation
# Conflicts: # test/unit/should_consolidate_input_and_output_types/expected.kt
@@ -18,6 +18,7 @@ interface QueryCompletableFuture { | |||
fun nonNullableResolver(arg: InputTypeGenerateFieldResolverInterfaces): java.util.concurrent.CompletableFuture<String> | |||
} | |||
|
|||
@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
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.
why does this need this annotation INPUT_OBJECT. This doesn't end with Input
and also this is an interface.
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.
This class is generated from this type which is an input
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.
Basically any input
that doesn't have a matching type
is going to get this annotation
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.
And vice versa - any type
that doesn't have a matching input
will get @GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT])
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.
Will add detailed docs on this later
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.
Makes sense
🎉 This PR is included in version 2.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
📝 Description
@GraphQLValidObjectLocations
to restrict the use of a schema class as an input or output. With schema-first development, we want to enforce that schema is defined first up front. Thus we always want to be intentional about how the generated classes can be used.🔗 Related Issues