I’m trying to use fauna-shell to upload schema.graphql:
fauna upload-graphql-schema fauna/schema.graphql --domain db.us.fauna.com --secret SECRET_HERE --mode override
But I keep getting:
UPLOADING SCHEMA (mode=override): fauna/schema.graphql
TypeError: Only HTTP(S) protocols are supported
EDIT:
Using the command
fauna upload-graphql-schema fauna/schema.graphql --endpoint https://graphql.us.fauna.com/import --secret SECRET_HERE --mode override
I get the following error:
Error: Could not Connect to undefined Unauthorized Secret
EDIT:
Using the command:
fauna upload-graphql-schema fauna/schema.graphql --domain graphql.us.fauna.com --secret asdasd --mode override
I get:
SyntaxError: Unexpected token I in JSON at position 0
at JSON.parse (<anonymous>)
at Object.parseJSON (/Users/aprilmintacpineda/.config/yarn/global/node_modules/faunadb/src/_json.js:16:15)
at /Users/aprilmintacpineda/.config/yarn/global/node_modules/faunadb/src/Client.js:318:33
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async UploadGraphQLSchemaCommand.getClient (/Users/aprilmintacpineda/.config/yarn/global/node_modules/fauna-shell/src/lib/fauna-command.js:104:7)
at async UploadGraphQLSchemaCommand.run (/Users/aprilmintacpineda/.config/yarn/global/node_modules/fauna-shell/src/commands/upload-graphql-schema.js:24:11)
at async UploadGraphQLSchemaCommand._run (/Users/aprilmintacpineda/.config/yarn/global/node_modules/@oclif/command/lib/command.js:43:20)
at async Config.runCommand (/Users/aprilmintacpineda/.config/yarn/global/node_modules/@oclif/config/lib/config.js:173:24)
at async Main.run (/Users/aprilmintacpineda/.config/yarn/global/node_modules/@oclif/command/lib/main.js:27:9)
at async Main._run (/Users/aprilmintacpineda/.config/yarn/global/node_modules/@oclif/command/lib/command.js:43:20)
SyntaxError: Unexpected token I in JSON at position 0
I have traced it here: faunadb-js/Client.js at v5 · fauna/faunadb-js · GitHub
If I console log the response you will get:
{
body: 'Invalid endpoint or method.',
headers: {
'access-control-allow-credentials': 'true',
'access-control-allow-headers': 'DNT,Keep-Alive,User-Agent,If-Modified-Since,Cache-Control,Content-Type,Authorization,X-Requested-With,X-Apollo-Tracing,X-Schema-Preview,X-Runtime-Cache-Enabled,X-Query-Timeout',
'access-control-allow-methods': 'GET,PUT,POST,DELETE,PATCH,OPTIONS',
'access-control-allow-origin': '*',
'access-control-max-age': '600',
'alt-svc': 'clear',
'content-length': '27',
'content-type': 'plain/text',
date: 'Fri, 24 Dec 2021 05:38:22 GMT',
via: '1.1 google'
},
status: 400
}
If I console log the options:
{ path: '', query: null, method: 'POST', body: '{"now":null}' }