Skip to content

GraphQL schema retrieval with URL and authorization header #54

Answered by anirudhsama
palmamartin asked this question in Q&A
Discussion options

You must be logged in to vote

This is now possible with the cli. Configure tsconfig.json with a schema option like so:

"plugins": [
	{
		"name": "@0no-co/graphqlsp",
		"tadaOutputLocation": "./graphql-env.d.ts",
		"schema": "./graphql/schema.graphql"
	}
]

And run the CLI command like below. It will output the schema file to the location specified above.

gql-tada generate-schema $GRAPHQL_URL --header "authorization: $AUTH_TOKEN"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kitten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants