Skip to content

Allow GraphQL request body to be a file path #24

Description

@benjamin-rood

At the moment it seems like only binary content can be provided as a file path.

For some requests, e.g. GraphQL to properly check coverage, the query might be > 1000 lines, and the schema might cover 100s of Query and Mutation endpoints. It's completely impractical to paste the raw query in every single spec file.

Using the example from the readme:

meta:
  name: GraphQL location service
configuration:
  host: api.graphloc.com
  scheme: https
specs:
  - name: Get Location of a given ip address
    request:
      method: post
      path: /graphql
      headers:
        - name: content-type
          value: application/json
      payload:
        body:
          type: json
          content:
            query: >
                   {
                    getLocation(ip: "8.8.8.8") {
                      country {
                        iso_code
                      }
                     }
                    }
            variables: null
            operationName: null
    response:
      status_code: 200
      json_data:
        - path: $.data.getLocation.country.iso_code
          value: US

It would be very useful for payload.body.content.query to be a file path rather than an inline query.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions