Difference between revisions of "GitHub-GraphQL"

From BITPlan Wiki
Jump to navigation Jump to search
m (Wf moved page GraphQL to GitHub-GraphQL without leaving a redirect)
Line 29: Line 29:
 
     at process._tickCallback (internal/process/next_tick.js:188:7)
 
     at process._tickCallback (internal/process/next_tick.js:188:7)
 
</pre>
 
</pre>
 +
 +
Trying
 +
https://api.github.com/graphql
 +
directly I get:
 +
<source lang='json'>
 +
{
 +
  "message": "This endpoint requires you to be authenticated.",
 +
  "documentation_url": "https://developer.github.com/v3/#authentication"
 +
}
 +
</source>

Revision as of 17:05, 16 March 2018

Trying to use the GitHub GraphQL API with GrapQL-Java i asked the following Stackoverflow question:

While waiting for an answer I found:

And therefore decided to download the MacOS package of npm from:

Which installed Node.js v8.10.0 and npm v5.6.0 on my system I could then install

npm install -g get-graphql-schema

after fixing the permission errors of the first attempt with

cd /usr/local/lib
sudo chmod g+w node_modules/
sudo chgrp staff node_modules/

Which lead to the error message

get-graphql-schema https://api.github.com/graphql > githubschema.graphql
TypeError: Cannot read property '__schema' of undefined
    at Object.buildClientSchema (/usr/local/lib/node_modules/get-graphql-schema/node_modules/graphql/utilities/buildClientSchema.js:48:43)
    at /usr/local/lib/node_modules/get-graphql-schema/dist/index.js:89:54
    at step (/usr/local/lib/node_modules/get-graphql-schema/dist/index.js:33:23)
    at Object.next (/usr/local/lib/node_modules/get-graphql-schema/dist/index.js:14:53)
    at fulfilled (/usr/local/lib/node_modules/get-graphql-schema/dist/index.js:5:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Trying https://api.github.com/graphql directly I get:

{
  "message": "This endpoint requires you to be authenticated.",
  "documentation_url": "https://developer.github.com/v3/#authentication"
}