Skip to content

Allow GraphQl queries to be in .graphql format #15

@ScottA38

Description

@ScottA38

Feature request, not a bug
I have finally successfully got a request working with this library, but for me it was a struggle

2 hurdles:

  1. Figuring out that I manually had to add 'Bearer' to my token (added PR to make issues with this clearer for user)
  2. Providing the correct format for the JSON query

This second issue I really think has some easy solutions, but I don't think am not a good enough Ruby programmer to provide the solution yet.
In my opinion it would be much neater to be able to write .graphql files in the _graphql dir, and then have query.rb simply parse the .graphql file and add the contents to the correct object structure, then generate the JSON.

As I understand anyways all requests to Graphql have to be wrapped in this same format (query sits under a json key called 'query'), so why not parse the graphql query file and compose small JSON wrapper it needs?

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions