Skip to content

Error using schema:publish with local .graphql schema file #672

@aergonaut

Description

@aergonaut

I am trying to publish my GraphQL schema to Apollo Engine with the apollo schema:publish command. According to the docs, I should be able to give --endpoint the path to a local .graphql file that contains my schema. However, when I try to do this, the command errors:

$ apollo schema:publish --endpoint=schema.graphql --key="REDACTED"
 ✔ Loading Apollo Project
 ✖ Uploading service to Engine
   → Only absolute URLs are supported
TypeError: Only absolute URLs are supported
    at getNodeRequestOptions (~/.nvm/versions/node/v9.11.2/lib/node_modules/apollo/node_modules/node-fetch/lib/index.js:1265:9)
    at ~/.nvm/versions/node/v9.11.2/lib/node_modules/apollo/node_modules/node-fetch/lib/index.js:1335:19
    at new Promise (<anonymous>)
    at fetch (~/.nvm/versions/node/v9.11.2/lib/node_modules/apollo/node_modules/node-fetch/lib/index.js:1332:9)
    at ~/.nvm/versions/node/v9.11.2/lib/node_modules/apollo/node_modules/apollo-link-http/lib/bundle.umd.js:91:17
    at new Subscription (~/

My GraphQL API is authenticated, so I can't point apollo directly at the endpoint as it won't have authentication. I was able to get around this by running my server locally and removing the authentication guards from the API endpoint, but I don't think that's a good long-term approach.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions