graphql .NET endpoint name

126 Views Asked by At

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

1

There are 1 best solutions below

0
Benny Afriat On

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'
    });