0

We are using graphql .net (Apollo Server)

Is the a way to change the URL endpoint?

So from

http://localhost:xxx/graphql

I want it to be

http://localhost:xxx/newEndpoint

Benny Afriat
  • 393
  • 1
  • 3
  • 12
  • Are you using GraphQL.NET on the server or the client? I guess this question is all about Apollo really? Which means you should just read the docs... https://www.apollographql.com/docs/apollo-server/v1/setup/ – DavidG Jan 06 '20 at 14:57
  • I meant apollo server, editing the question – Benny Afriat Jan 06 '20 at 15:35
  • So there's no need to mention .NET at all, and my link above still stands - read the docs! – DavidG Jan 06 '20 at 15:37

1 Answers1

0

OK i just figured it out, it's pretty simple.

On the server side all you have to do it state the endpoint you desire when configuring the server.

app.UseGraphQL<YourSchema>("/yourNewEndPoint");

on the client side you also need to modify the uri you are passing to httpLink

    const http = httpLink.create({
        uri: 'http://localhost:port/yourNewEndPoint'
    });
Benny Afriat
  • 393
  • 1
  • 3
  • 12