1

There is a graphql api in a subgraph owned by another team

type Query {
  user: UserInfo
}

Our team wants to create a new graphql api in our subgraph that return the same data type as a proxy.

type Query {
  specialUser(encryptedUserId: ID): UserInfo
}

In our proxy, we will first decode the user id, then check if valid, then call the other team's api to get UserInfo, then do some modification to the result then return it.

Note the UserInfo object is very complicated, so we don't want to re-create resolver for each field.

I didn't find a way to extract the query then pass to the other team's api. We're using https://netflix.github.io/dgs/ and apollo in backend.

FrankGod
  • 91
  • 7

1 Answers1

0

The question is difficult to understand exactly but...

You can query the 'other team's' api and get the result from that query and then run your own separate query against the first query results.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 12 '23 at 00:22