Parked
FDM GraphQL Queries: cast interfaces to their concrete implementation
Please add support for missing GraphQL feature ... “spread on types”. This allows generic types to be cast to their concrete implementation when querying the data.
Example FDM and Query Below:
type Stall {
name: String!
stallNumber: String!
availableProduce: [Produce]
}
interface Produce {
name: String!
quantity: Int!
price: Int!
nutrients: [String]
vendor: Stall
region: String!
}
type Fruit implements Produce {
name: String!
quantity: Int!
price: Int!
nutrients: [String]
vendor: Stall
region: String!
isSeedless: Boolean
ripenessIndicators: [String]
}
type Vegetable implements Produce {
name: String!
quantity: Int!
price: Int!
nutrients: [String]
vendor: Stall
region: String!
vegetableFamily: String
isPickled: Boolean
}
query {
listStall {
items {
availableProduce {
items {
__typename
name
price
... on Fruit {
hasEdibleSeeds
}
... on Vegetable {
vegetableFamily
}
}
}
}
}
}
https://cognite.zendesk.com/hc/en-us/requests/9189
https://graphql.com/learn/interfaces-and-unions/#fragments
Check the
documentation
Ask the
Community
Take a look
at
Academy
Cognite
Status
Page
Contact
Cognite Support
