To manually test how the server handles federated entities, you can use the GraphiQL interface (typically at /graphiql). Use the _entities query with _Any type representations to verify that different keys and types are resolved correctly.
query ($representations: [_Any!]!) {
_entities(representations: $representations) {
__typename
...on DeprecatedProduct { sku package reason }
...on Product { id sku createdBy { email name } }
...on ProductResearch { study { caseNumber description } }
...on User { email name }
}
}
# Variables:
{
"representations": [
{
"__typename": "DeprecatedProduct",
"sku": "apollo-federation-v1",
"package": "@apollo/federation-v1"
},
{
"__typename": "ProductResearch",
"study": {
"caseNumber": "1234"
}
},
{ "__typename": "User", "email": "support@apollographql.com" },
{
"__typename": "Product",
"id": "apollo-federation"
},
{
"__typename": "Product",
"sku": "federation",
"package": "@apollo/federation"
},
{
"__typename": "Product",
"sku": "studio",
"variation": { "id": "platform" }
}
]
}