-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from oleg-nenashev/protocol-docs
Add gRPC and GraphQL to the solution pages
- Loading branch information
Showing
15 changed files
with
274 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
layout: solution | ||
title: "WireMock and GraphQL" | ||
meta_title: "GraphQL Solutions | WireMock" | ||
description: "Additional solutions for WireMock when using Golang" | ||
logo: /images/logos/technology/graphql.svg | ||
og_image: solutions/graphql/wiremock_graphql_opengraph.png | ||
redirect_from: | ||
- "/graphql.html" | ||
- "/graphql/" | ||
hide-disclaimer: true | ||
--- | ||
|
||
## WireMock Extension | ||
|
||
There is a [GraphQL extension for WireMock](https://github.com/wiremock/wiremock-graphql-extension) | ||
that allows semantically matching GraphQL queries, | ||
regardless of the order of the fields in the original request. | ||
It brings powers of request matching and response templating to the | ||
[GraphQL](https://graphql.org/) query language. | ||
|
||
Example: | ||
|
||
```kotlin | ||
import com.github.tomakehurst.wiremock.client.WireMock | ||
import com.github.tomakehurst.wiremock.client.WireMock.* | ||
import io.github.nilwurtz.GraphqlBodyMatcher | ||
|
||
fun registerGraphQLWiremock(json: String) { | ||
WireMock(8080).register( | ||
post(urlPathEqualTo(endPoint)) | ||
.andMatching(GraphqlBodyMatcher.extensionName, GraphqlBodyMatcher.withRequest(json)) | ||
.willReturn( | ||
aResponse() | ||
.withStatus(200) | ||
) | ||
) | ||
} | ||
``` | ||
|
||
## Read More | ||
|
||
- [GraphQL API mocking with the new WireMock extension](https://www.wiremock.io/post/graphql-api-mocking-with-the-new-wiremock-extension?utm_medium=referral&utm_source=wiremock.org&utm_content=solution-page) | ||
blogpost by Eiki Hayashi | ||
- [GitHub repository with documentation](https://github.com/wiremock/wiremock-graphql-extension) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.