-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(federation): match JS condition order with multiple skip/include …
…on the same selection Rust was iterating in a consistent order, JS iterates in declaration order. Surprisingly this was the only place we use the consistent order. This removes the `iter_sorted()` method from DirectiveList that is now no longer used. Internally, DirectiveList still uses the consistent sort order for hashing and equality. I think it's somewhat nicer to use the consistent order here, so you do not get different plans based on an innocuous input difference, but so be it. We can consider using a consistent order everywhere we handle directives in the future.
- Loading branch information
1 parent
0dd8322
commit 3d8021f
Showing
3 changed files
with
60 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
apollo-federation/tests/query_plan/supergraphs/condition_order_router799.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Composed from subgraphs with hash: 3ebe0e8c55ad21763879da6341617f14953e80d7 | ||
schema | ||
@link(url: "https://specs.apollo.dev/link/v1.0") | ||
@link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) | ||
{ | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
directive @join__directive(graphs: [join__Graph!], name: String!, args: join__DirectiveArguments) repeatable on SCHEMA | OBJECT | INTERFACE | FIELD_DEFINITION | ||
|
||
directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE | ||
|
||
directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION | ||
|
||
directive @join__graph(name: String!, url: String!) on ENUM_VALUE | ||
|
||
directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE | ||
|
||
directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR | ||
|
||
directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION | ||
|
||
directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA | ||
|
||
scalar join__DirectiveArguments | ||
|
||
scalar join__FieldSet | ||
|
||
enum join__Graph { | ||
BOOKS @join__graph(name: "books", url: "none") | ||
} | ||
|
||
scalar link__Import | ||
|
||
enum link__Purpose { | ||
""" | ||
`SECURITY` features provide metadata necessary to securely resolve fields. | ||
""" | ||
SECURITY | ||
|
||
""" | ||
`EXECUTION` features provide metadata necessary for operation execution. | ||
""" | ||
EXECUTION | ||
} | ||
|
||
type Mutation | ||
@join__type(graph: BOOKS) | ||
{ | ||
bookName(name: String!): Int! | ||
} | ||
|
||
type Query | ||
@join__type(graph: BOOKS) | ||
{ | ||
bookName: String! | ||
} |