Skip to content

Commit

Permalink
Merge branch 'master' into service_virtualization
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrosario committed Aug 29, 2024
2 parents 4c1b6a0 + 837994b commit 3feed20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
remote_theme: pmarsceill/just-the-docs
markdown: kramdown
title: "Specmatic"
latest_release: 2.0.16
latest_release: 2.0.17
jms_release: 0.1.0
kafka_release: 0.4.0
db_release: 0.61.8-db
Expand Down
6 changes: 3 additions & 3 deletions documentation/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ Let us now take deeper look at the external example format.

#### HTTP Headers

GraphQL SDL files do not support HTTP headers. However, you can directly add them to your Specmatic example files in `httpHeaders` under the `request` key, as seen in the example yaml in the previous section. The headers will be leveraged if present both by the contract tests as well as service virtualization.
Although GraphQL SDL files do not support HTTP request headers, you may directly add them to your Specmatic example files in `httpHeaders` under the `request` key, as seen in the example yaml in the previous section. The headers will be leveraged if present both by the contract tests as well as service virtualization.

#### GraphQL Variables

Specmatic supports usage of GraphQL variables seamlessly. You only need to make sure that the externalised example is structured such that it uses the actual field values inline instead of variables in the query. Here is an example.

Say suppose, below request is that is being sent by your GraphQL Consumer to Specmatic GraphQL service virtualization server.

```JSON
```json
{
"operationName": "FindAvailableProducts",
"variables": {
Expand All @@ -143,7 +143,7 @@ Say suppose, below request is that is being sent by your GraphQL Consumer to Spe

As you can see, the above request from GraphQL consumer includes a variable called `$pageSize`. However in our example we will not be using it, instead we will be using the actual value (`pageSize: 10`) to match a request that comes with that value.

```YAML
```yaml
request:
body: |
findAvailableProducts(type: "gadget", pageSize: 10) {
Expand Down
2 changes: 1 addition & 1 deletion documentation/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ To provide appropriate example values, you can create an example JSON file that
}
```

This file should be stored in a directory called `specmatic/<file_name_without_extension>_examples`, which is colocated in the same directory as the `.proto` file. This ensures that the example data is easily accessible and logically organized alongside the corresponding `.proto` files.
This file should be stored in a directory called `<file_name_without_extension>_examples`, which is colocated in the same directory as the `.proto` file. This ensures that the example data is easily accessible and logically organized alongside the corresponding `.proto` files.

Alternatively, you can specify the location of the example directories programmatically or via CLI arguments when running tests or service virtualization. This approach allows for flexibility in how and where the examples are stored, depending on your project’s structure or deployment environment.

Expand Down

0 comments on commit 3feed20

Please sign in to comment.