Closed simonw closed 4 years ago
Here's partial code for outputting it:
from graphql import print_schema
schema = await schema_for_database(datasette, database=database)
if request.args.get("schema"):
return Response.text(print_schema(schema))
According to https://github.com/graphql/graphql-spec/issues/203#issuecomment-242140024 the internal standard file extension for these at Facebook is .graphql
.
I'm going to use the URL to the database-specific endpoint with graphql
on the end for this, e.g.
https://datasette-graphql-demo.datasette.io/graphql/github.graphql
From this Twitter conversation I learned how to output a GraphQL schema: https://twitter.com/simonw/status/1292193658700144640
Example output here: https://gist.github.com/simonw/21b2f0878d4e4e20d514b8544b296393 - a snippet: