graphql-tester

command module
v0.0.0-...-73a082e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2018 License: MIT Imports: 8 Imported by: 0

README

Graphql tester - Tool for testing GraphQL

Build Status

Motivation

in progress

Usage
docker run -v `pwd`/github_api:/data imega/graphql-tester:0.0.1 -H 'Authorization: Bearer <token>' -u https://api.github.com/graphql /data

token - Creating a personal access token

Referense
The test case

The test case specification in the data part is composed by a series of test blocks. Each test block usually corresponds to a single test case, which has a title, an optional description, and a series of data sections. The structure of a test block is described by the following template.

# Title suite test

=== Test 1.

--- query
query {
    viewer {
        id
        login
    }
}

--- query_var
{
    "variables": {
        "input": {
            "login": "blah-blah-blah"
        }
    },
    "operationName": "GetLogin"
}

--- expected_response
{
    "data": {
        "viewer": {
            "login": "iMega"
        }
    }
}

--- assert_not_empty
data.viewer.login

--- assert_empty
data.viewer.id

--- set_vars_from_response
@login = data.viewer.login

Examples

See folder github_api

Conditions

jq retuns json value from request, accept arg []byte equal returns error if values not equal has retuns error if array not exists value !equal see equa; !has

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL