graphql-fetch
graphql-fetch copied to clipboard
Remove mandatory variable Definitions and allow access token in header
For queries which don't require variables the code was breaking as _context.variableDefinitions
would be null and upon reading variableDefinitions
would throw error.
Adding following checks:-
- Reading
variableDefinitions
only if_context.variableDefinitions
is present. - If variables is set then assigning to final query else assigning null
Auth token changes:-
- allowing option to pass auth token in the api calls.