Closed simonw closed 4 years ago
GraphQL doesn't really like this - it wants everything to be in the schema. But Datasette and SQLite both support columns with arbitrary JSON in them, and it's a bit inconvenient that those come back from a GraphQL query looking like this:
Graphene has a solution for this: https://github.com/graphql-python/graphene/issues/384
from graphene.types import generic ... field generic.GenericScalar()
Question is: how do we know which columns this should be applied to? Probably needs plugin configuration.
Documentation: https://github.com/simonw/datasette-graphql/blob/56bac67ce2839693723e41919075d7d75e9cb969/README.md#columns-containing-json-strings
Demo: https://datasette-graphql-demo.datasette.io/graphql/fixtures?query=%7B%0A%20%20repos%20%7B%0A%20%20%20%20nodes%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20tags%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A
GraphQL doesn't really like this - it wants everything to be in the schema. But Datasette and SQLite both support columns with arbitrary JSON in them, and it's a bit inconvenient that those come back from a GraphQL query looking like this:
Graphene has a solution for this: https://github.com/graphql-python/graphene/issues/384
Question is: how do we know which columns this should be applied to? Probably needs plugin configuration.