wiremock / wiremock/WireMock.Net
How do I use GraphQLMatcher for file mapping
@StefH is already working on this.
Since Jul 18, 2025.
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 240
- Avg merge
- 5d 12h
- Merged PRs (30d)
- 2
Description
Hi, I want to ask question about GraphQLMatcher and how to use them.
I've been trying to use them in both format, both on C# and Json Mapping but found no success. Basically, I don't understand the feature in overall.
Do I have to provided schema first ? then start mocking the query? and how would that look like especially in Json Mapping. To clarify my use case, let's say I have this as my schema for entire application.
var TestSchema = @"
type Query {
greeting:String
students:[Student]
studentById(id:ID!):Student
}
type Student {
id:ID!
firstName:String
lastName:String
fullName:String
}";
How do I match with query for /graphql with and stub the response
query MyNewQuery($studentId: Int!) {
studentById(id: $studentId) {
fullName
}
}
Currently, my work around is to use JsonPartialMatcher but proven to not effective and I really want to try this feature.
I can help PR to update the docs once I can understand how its work. Thanks in advance
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.