In order to use GraphiQL a route/endpoint needs to be declared:
https://github.com/neelance/graphql-go/blob/beff08417b04a91f0a7618b55786d63eec833b9f/example/starwars/server/server.go#L19
It fetches information from another one, /query in this case
Can the latter be modified to something arbitrary (e.g, /api) and use a single endpoint for both? I mean this because not only query requests are sent to this endpoint, but mutation ones as well. it might sound trivial yet it's something meaningful for some of us.
Convention I've often seen in GraphQL backends is that POST /graphql is the query/mutation endpoint, and GET /graphql can be used to fetch the GraphiQL frontend. I've also seen GET /graphiql (with the "i") for the frontend.
That pattern has always made sense to me.
Most helpful comment
Convention I've often seen in GraphQL backends is that
POST /graphqlis the query/mutation endpoint, andGET /graphqlcan be used to fetch the GraphiQL frontend. I've also seenGET /graphiql(with the "i") for the frontend.That pattern has always made sense to me.