Skip to content

Commit

Permalink
Merge pull request #25 from znsio/graphql_variables_and_headers
Browse files Browse the repository at this point in the history
Use yaml examples instead of md for graphql and add headers support
  • Loading branch information
yogeshnikam671 authored Aug 27, 2024
2 parents 73a9519 + ef0e9d7 commit 7b22786
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 62 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
request:

Check warning on line 1 in io/specmatic/examples/store/graphql/products_bff_examples/createProduct.yaml

View workflow job for this annotation

GitHub Actions / Check API Contracts

unrecognized-format
body: |
mutation {
createProduct(newProduct: {
name: "The Almanac",
inventory: 10,
type: book
}) { id name inventory type }
}
response: {
"id": "10",
"name": "The Almanac",
"inventory": 10,
"type": "book"
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# Find Available Products
request:

Check warning on line 1 in io/specmatic/examples/store/graphql/products_bff_examples/findAvailableProducts.yaml

View workflow job for this annotation

GitHub Actions / Check API Contracts

unrecognized-format
httpHeaders:
X-region: north-west
body: |
query {
findAvailableProducts(type: gadget, pageSize: 10) { id name inventory type }
}
Request

```graphql
query {
findAvailableProducts(type: gadget, pageSize: 10) { id name inventory type }
}
```

Response

```json
[
response: [
{
"id": "10",
"name": "The Almanac",
Expand All @@ -25,4 +20,3 @@ Response
"type": "gadget"
}
]
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
request:

Check warning on line 1 in io/specmatic/examples/store/graphql/products_bff_examples/findOffersForDate.yaml

View workflow job for this annotation

GitHub Actions / Check API Contracts

unrecognized-format
body: |
query {
findOffersForDate(date: "2024/12/31") { offerCode, validUntil }
}
response: [
{
"offerCode": "WKND30",
"validUntil": "2024/12/12"
},
{
"offerCode": "SUNDAY20",
"validUntil": "2024/12/25"
}
]

0 comments on commit 7b22786

Please sign in to comment.