Skip to content

How best to test the __resolveReference resolver? #5866

Answered by lennyburdette
tjmgregory asked this question in Q&A
Discussion options

You must be logged in to vote

You can pretend to be the gateway and executing the __resolveReference functions by calling the _entities field like this:

query ($representations: [_Any!]!) {
  _entities(representations: $representations) {
    ... on User {
      id
      username
    }
  }
}

which is documented here: https://www.apollographql.com/docs/federation/subgraphs/#query_entities

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tjmgregory
Comment options

Answer selected by tjmgregory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants