Comments (7)
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.
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.
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.
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.
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.
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.
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)
- GraphQLIgnore annotation not respected when running GraalVM native image
- Spring Boot 3.1.6 health endpoint latency is very high when other query is running. HOT 10
- Unable to perform upgrade as it is not requested by the client: request should have Upgrade and Connection headers filled properly HOT 1
- [ktor server] Ability to specify custom GraphQL server
- GraphQL client gradle plugin fails to find `compileDebugKotlin` task.
- Make `src/main/resources` configurable for GraphQL clients HOT 1
- Spring WebFlux: How to autowire a service/component in a CustomDirective behavior?
- ControllerAdvice and ModelAttribute
- [generator] support directives using input object args
- GraphQL Ktor plugin swallows context exceptions. HOT 3
- Ktor: Flow/Subscription websocket stops working (Ping Timeout)
- Why do I get this error when I start the application HOT 2
- No code generation occurs, no logs explaining why HOT 9
- feat: allow classes corresponding to SDL to be decoupled from implementation
- Unable to retrieve federated types with apollo federation v1 HOT 1
- Add plugin configuration option to allow generating test client files into testFixtures sources root
- @ShareableDirective causes schema generation error when applied to class used as both input and output
- FederatedSchemaValidator rejects nested union type field set HOT 1
- Union Annotations Do Not Play Well with @GraphQLDescription and @Deprecated
- FunctionDataFetcher: does not handle `Error` descendant `Throwables` in `runBlockingFunction` in conjunction with GraphQL Java `graphql/execution/ExecutionStrategy.java`
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-kotlin.