simonw / datasette-graphql

Datasette plugin providing an automatic GraphQL API for your SQLite databases
https://datasette-graphql-demo.datasette.io/
Apache License 2.0
101 stars 6 forks source link

Customize path for GraphiQL interface #92

Closed bbbbbrie closed 1 year ago

bbbbbrie commented 1 year ago

Hello! I love this plugin!

The docs say:

This plugin sets up /graphql as a GraphQL endpoint for the first attached database.

I’m curious: is it possible to customize the /graphql path? I couldn’t find anything about this in the docs. I’m curious if you have recommendations on how to best to this.

Thank you!

— Brie 🦄🌈

simonw commented 1 year ago

This is a good idea - I need this for https://til.simonwillison.net/ too.

simonw commented 1 year ago

I'll do this using a metadata setting like so:

{
  "plugins": {
    "datasette-graphql": {
      "path": "/-/graphql"
    }
  }
}
simonw commented 1 year ago

Here's a demo of it working: https://til.simonwillison.net/-/graphql - configured by https://til.simonwillison.net/-/metadata

bbbbbrie commented 1 year ago

Yay! 🎉 I have this working on my end, too.

Thank you very much, Simon! 🙏