Comments (6)
Oh.. is this a duplicate of #224?
I think what works is:
@GraphQLQuery(description='this is a cool description')
... but to be honest: this is not obvious.
I would do the following thing:
- use @GraphQLArgument for arguments of querys / mutations
- use @GraphQLInputField for input fields in graphql schema
- use new annotation @GraphQLTypeField for type fields in graphql schema
+ remove the logic for @GraphQLQuery on fields
Did I forgot something?
from graphql-spqr.
This has been suggested before, but the reason I decided not to do anything about is straight forward: all fields are queries and all queries are fields. There is nothing special about top-level fields/queries in GraphQL. They are merely fields of the root types (that are themselves just regular types). And this isn't only an implementation detail, but a rather important aspect of GraphQL's design that I believe should not be obscured behind Java-specific, or worse yet SPQR-specific terminology. In other words: I want the users to think in GraphQL terms, and not Java terms, as it is the GraphQL schema you're designing, after all. Java is merely the language we use instead of SDL :)
from graphql-spqr.
And yes, you got it right — you can place @GraphQLQuery
to any output field anywhere :)
from graphql-spqr.
This has been suggested before, but the reason I decided not to do anything about is straight forward: all fields are queries and all queries are fields. There is nothing special about top-level fields/queries in GraphQL. They are merely fields of the root types (that are themselves just regular types). And this isn't only an implementation detail, but a rather important aspect of GraphQL's design that I believe should not be obscured behind Java-specific, or worse yet SPQR-specific terminology. In other words: I want the users to think in GraphQL terms, and not Java terms, as it is the GraphQL schema you're designing, after all. Java is merely the language we use instead of SDL :)
Okay, I agree with that and I understand the reasoning behind your decision of naming.
But something like that should be in a rich documentation about the "framework" SPQR.
Is there any plan on going for a documentation like DGS has? https://netflix.github.io/dgs/getting-started/
Or spring graphql? https://docs.spring.io/spring-graphql/docs/current/reference/html/
If not, is it time to start writing some? I would start with really basic use cases and you could go along with the more advanced stuff, if you like to. Maybe you could bootstrap a project for that and care about the "integration" to refer to it on the README's and we could contribute to it.
from graphql-spqr.
To be honest, any help with documentation would be the best contribution this project could receive.
If you decide to write anything, I'll publish it on GitHub pages...
from graphql-spqr.
I'll close this issue and open a new one as the discussion has now gone in a different direction.
from graphql-spqr.
Related Issues (20)
- Apply bean validation annotations only if an appropriate group is enabled [Breaking]
- How to use executionResult data HOT 2
- Failing tests - ComplexityTest class
- Explicitly register Java classes to the GraphQL schema. HOT 4
- How to map a java class to GraphQL interface without using @GraphQLInterface annotation? HOT 5
- Best way to error handling HOT 1
- Help in Handling Exceptions with SPQR HOT 1
- Question: Extending an InputObject type and handle it in SPQR HOT 3
- SDL Printing Fails on Schema Directives with Arguments HOT 4
- Spring 3.2: Cannot resolve parameter names for constructor public io.leangen.graphql.spqr.spring.web.dto.GraphQLRequest(java.lang.String,java.lang.String,java.lang.String,java.util.Map) HOT 2
- Compile parameters to support Spring Boot 3.2.1 (Spring Framework 6.1) HOT 1
- null values sent in response json HOT 1
- Schema Generation Regression in 0.12.4 HOT 1
- Polymorphism type on input
- Scalars containing an Instant cannot be serialized over subscription
- Schema generation at compile time?
- BUG: The DelegatingTypeResolver breaks when updating the GraphQLSchema using a Visitor HOT 1
- Feature Request: Add support for GraphQLOutputType to the SchemaTransformer HOT 39
- Make a public OperationMapper#createResolver overload to help with creating custom field resolvers
- Mark the gson-java8-datatype dependency as optional HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-spqr.