GithubHelp home page GithubHelp logo

Comments (6)

ErtugrulSener avatar ErtugrulSener commented on June 13, 2024

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.

kaqqao avatar kaqqao commented on June 13, 2024

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.

kaqqao avatar kaqqao commented on June 13, 2024

And yes, you got it right — you can place @GraphQLQuery to any output field anywhere :)

from graphql-spqr.

ErtugrulSener avatar ErtugrulSener commented on June 13, 2024

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.

kaqqao avatar kaqqao commented on June 13, 2024

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.

kaqqao avatar kaqqao commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.