how to set proxy for apollo/client for server side nestjs

how to set proxy for apollo/client for server side nestjs


0

Resolver file

@Resolver()
export class LaunchResolver {
  private readonly client: ApolloClient<any>;

  constructor() {
    this.client = new ApolloClient({
      uri: 'https://spacex-production.up.railway.app/graphql',
      cache: new InMemoryCache(),
    });
  }

  @Query('launches')
  async getLaunches(): Promise<Launch[]> {
    const response = await this.client.query({
      query: gql`
        query GetLaunches {
          launches {
            mission_name
            launch_date_utc
          }
        }
      `,
    });
    return response.data.launches;
  }
}

I am running this uri behind the proxy e.g abc.xyz.com:8000

Not sure how use proxy to reach this api and query the data, let me know if you worked on it.

Thanks

Share
Improve this question


Load 5 more related questions


Show fewer related questions

0

Reset to default



Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *