Giter Site home page Giter Site logo

Comments (7)

d4rken avatar d4rken commented on May 23, 2024

Are they not already ordered? AFAIK we process them in annotation order and tthe annotations are arrays/lists. So the order in which they are processed should be either top-to-bottom or bottom-to-top?
We could add a unit-test though that checks this...

from graphql-kotlin.

dariuszkuc avatar dariuszkuc commented on May 23, 2024

AFAIK neither Kotlin nor Java explicitly specify the order in which annotations are read. This means that while it is true that currently the returned array is in the order that they are defined on the fields there is no guarantee that this might not change in the future.

from graphql-kotlin.

dariuszkuc avatar dariuszkuc commented on May 23, 2024

I was thinking whether we should do something similar to what Spring does in their usage of Ordered (e.g. using Spring annotations ensuring that we run in transaction @Transactional only if data is not cached using @Cacheable, etc)

from graphql-kotlin.

d4rken avatar d4rken commented on May 23, 2024

I think java does guarantee ordering and thus Kotlin too.

Functionality wise I also thought about Spring, but I'm not sure we need new annotation for that. We could also add paramters to GraphQLDirective, e.g. priority.

Has this come up in a use-case? I'm not sure we should add this just because java/kotlin could change behavior, that's a bit Pandora's box.

from graphql-kotlin.

dariuszkuc avatar dariuszkuc commented on May 23, 2024

I did saw that post but it also reiterates that while currently there is an order it is implied indirectly and there is no guarantee it might not change in the future. That being said I've updated the original description to reflect it is exploratory.

from graphql-kotlin.

smyrick avatar smyrick commented on May 23, 2024

I am also fine not doing anything until we need to. And if we do implement maybe just adding a simple priority: Int

from graphql-kotlin.

dariuszkuc avatar dariuszkuc commented on May 23, 2024

Closing this as I don't think we'll be doing this anytime soon. We'll reopen if the need arise.

from graphql-kotlin.

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.