simonw / datasette-graphql

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

json_columns not respected by datasette-graphql after publishing #70

Open mhalle opened 3 years ago

mhalle commented 3 years ago

Summary: Through the datasette-graphql endpoint, JSON columns that are respected by json_columns in a local install of datasette are interpreted as plain strings in a vercel-published or fly-published instance.

I have the following fragment in my metadata.json (I only have one database and table):

{
    "plugins": {
        "datasette-graphql": {
            "json_columns": [
                "dcc", "keywords", "dcc_code"
            ]
        }
}

If I run in a local install using datasette ., the graphql instance shows JSON as JSON.

If I publish using datasette-publish-vercel --install datasette-graphql, the JSON is interpreted as strings by the graphql endpoint. Same thing happens when I publish to fly.io.

simonw commented 3 years ago

Did you pass the metadata.json file to the publish command, like this?

datasette publish vercel data.db -m metadata.json --install datasette-graphql