-
Hello, We utilize directive-based stitching in our application, which performs well. The gateway effectively discovers and reloads subschemas, and fetches all required data as expected. However, we've noticed that in the response, the fetched types are not merged correctly. Consider the following example: query meals {
meals(ids: ["123456"]) {
id
recipe {
id
name
recipeEntries {
amount
unit
product {
id
supplier
}
}
}
}
} The type Product {
id: ID!
} And the type Query {
_products(ids: [ID!]!): [Product]! @merge(keyField: "id", keyArg: "ids")
_sdl: String!
}
type Product @key(selectionSet: "{ id }") {
id: ID!
supplier: Supplier!
} The merged result contains all products, but they are incorrectly merged into the We found a temporary fix: sorting the result of We're wondering if this ordering is actually required (as we could not find this in any specification) or if there is any other problem with our code. We expected the merging to be based on the ID and not the order. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry, we just forgot to add some @key directives to our types. In the example above (recipes-subschema):
|
Beta Was this translation helpful? Give feedback.
Sorry, we just forgot to add some @key directives to our types.
In the example above (recipes-subschema):