Star

Created With

linkGraphQL Spec

linkCreating a Spec

Create a new spec under the specs/ folder:

specs/graphql-service.yml
1linkmeta:

2link name: GraphQL location service

3linkconfiguration:

4link host: graphql.contentful.com

5link scheme: https

6link base_path: /content/v1

7linkspecs:

8link - name: Get list of Lesson collections

9link request:

10link method: post

11link path: /spaces/f8bqpb154z8p/environments/master

12link query_params:

13link - name: access_token

14link value: 9d5de88248563ebc0d2ad688d0473f56fcd31c600e419d6c8962f6aed0150599

15link headers:

16link - name: content-type

17link value: application/json

18link payload:

19link body:

20link type: json

21link content:

22link query: >

23link {

24link lessonCollection(where: {OR: [{title_contains: "content"}, {title_contains: "SDK"}]}) {

25link items {

26link title

27link slug

28link }

29link }

30link }

31link variables: null

32link operationName: null

33link response:

34link status_code: 200

35link json_data:

36link - path: $.data.lessonCollection.items[0].title

37link value: Content model

38link - path: $.data.lessonCollection.items[0].slug

39link value: content-model



linkRun the Spec

Run the spec from the terminal:

1link$./node_modules/.bin/rest-ez

Test Suite path/pattern/directory is not specified, Looking for suites in specs directory Found suites: - specs/graphql-service.yml Launcher will run suites: specs/graphql-service.yml ✓ Get list of Lesson collections (649ms) Done: specs/graphql-service.yml (Passed) 0 skipped, 0 failed, 1 passing (1 tests) 0 skipped, 0 failed, 1 passing (1 suites) Duration: 667ms
GraphQL SpecCreating a SpecRun the Spec

Home

Getting Startedchevron_right
Basicschevron_right
Requestchevron_right

Request Basics Headers Cookies Query Parameters Path Parameters

Payload Bodychevron_right

File Uploads Auto-Retry Additional Options

Response Validationchevron_right

Overview

Assertionschevron_right

Status Code Headers & Cookies

Bodychevron_right
Hooks & JSchevron_right

Overview

Function Typeschevron_right
Suite-Level Hookschevron_right
Spec-Level Hookschevron_right
Contextchevron_right
DRY & Reusing Specschevron_right
Command Line Interface (CLI)chevron_right