401 error when generating code from GitHub GraphQL schema #68
Closed
SwiftDevJournal
started this conversation in
General
Replies: 1 comment
-
The old version of the query builder generator relied on having all scalars configured upfront. That's no longer the case in the new version, though. I suggest you give it a try with the new version - there's also an example of integrating with GitHub's GraphQL API in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to generate code from GitHub's GraphQL schema using the swift-graphql command-line tool. I created a GitHub personal access token. I run the following command:
swift-graphql https://api.github.com/graphql --output github-schema.swift --authorization "MyAccessTokenString"
But I get a 401 error. I also tried removing the quotes from the string for the access token, but I get the same error.
I also tried downloading the GitHub GraphQL schema to my Mac and running the
swift-graphql
command on the local file, but I get an error code 1002, unsupported URL.UPDATE
I tried adding
bearer
to the authorization,swift-graphql https://api.github.com/graphql --output github-schema.swift --authorization "Bearer MyAccessTokenString"
But I get the error
unknown scalar("DateTime")
.What do I have to do to generate SwiftGraphQL code from GitHub's GraphQL schema?
Beta Was this translation helpful? Give feedback.
All reactions