-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error using schema:publish
with local .graphql schema file
#672
Comments
I am also facing the same issue here : 2018-11-09T13:24:40.443Z - ERROR - command:engine:upload - Error: Command failed: apollo schema:publish --endpoint="/myAbsolutePath/front-end/src/config/schema.json" --key="XXX"
TypeError: Only absolute URLs are supported
at getNodeRequestOptions (~/Documents/moviepro/api/node_modules/apollo-env/node_modules/node-fetch/lib/index.js:1265:9)
at ~/Documents/moviepro/api/node_modules/apollo-env/node_modules/node-fetch/lib/index.js:1335:19
at new Promise (<anonymous>)
at fetch (~/Documents/moviepro/api/node_modules/apollo-env/node_modules/node-fetch/lib/index.js:1332:9)
at ~/Documents/moviepro/api/node_modules/apollo-link-http/lib/bundle.umd.js:91:17
at new Subscription (~/Documents/moviepro/api/node_modules/zen-observable/lib/Observable.js:179:34)
at Observable.subscribe (~/Documents/moviepro/api/node_modules/zen-observable/lib/Observable.js:258:14)
at ~/Documents/moviepro/api/node_modules/apollo-link/lib/bundle.umd.js:64:24
at new Promise (<anonymous>)
at Object.toPromise (~/Documents/moviepro/api/node_modules/apollo-link/lib/bundle.umd.js:63:16)
at ChildProcess.exithandler (child_process.js:276:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Socket.stream.socket.on (internal/child_process.js:336:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:561:12) |
Same here. I'm writing the schema to a json file using |
I tried to run even a tmp express server, serving a static graphql.json schema... but when providing an url, it seems that the url is directly read from the apollo api, not from the publish command... |
For now I was able to use an
|
@flipxfx What does your original command look like? I created a custom apollo.config.js file and put that in the cmd and still the same results. Thanks! |
It's just |
Please note that the documentation says module.exports = {
client: {
service: {
url: 'http://localhost:4000/graphql',
},
includes: ['{client,server}/src/**/*.{ts,tsx}'],
},
}; Using |
That's documentation for editor plugins, not what the original question is. Here is the conflicting documentation that says --endpoint can be configured as a local file. https://www.apollographql.com/docs/engine/features/schema-history.html#schema-sources |
@flipxfx thanks for pointing out the dated docs, should be up-to-date now! |
Thanks @trevor-scheer |
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: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.The text was updated successfully, but these errors were encountered: