Skip to content

Commit 9632b77

Browse files
deploy: b2f0f3f
1 parent b83685e commit 9632b77

106 files changed

Lines changed: 5306 additions & 1150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GraphQL/customized-graphql-urls/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"type" : "Guide",
110110
"previewEnabled" : false,
111111
"support" : {
112-
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
112+
"link" : "https://github.com/testingisdocumenting/webtau/discussions",
113+
"title" : "GitHub"
113114
}
114115
},
115116
"page" : {
@@ -199,12 +200,13 @@
199200
"lang" : "groovy",
200201
"snippet" : "package org.testingisdocumenting.webtau.graphql\n\nimport org.testingisdocumenting.webtau.graphql.config.GraphQLHttpConfiguration\nimport org.testingisdocumenting.webtau.graphql.model.GraphQLRequest\n\nclass CustomGraphQLHttpConfiguration implements GraphQLHttpConfiguration {\n // Note: our test server requires the graphql endpoint to start with \"graphql\"\n public static final CUSTOM_GRAPHQL_ENDPOINT = 'graphql-custom'\n\n @Override\n String requestUrl(String url, GraphQLRequest graphQLRequest) {\n if (null != graphQLRequest.operationName && !graphQLRequest.operationName.isEmpty()) {\n return \"${CUSTOM_GRAPHQL_ENDPOINT}?operation=${graphQLRequest.operationName}\"\n }\n return url\n }\n}",
201202
"title" : "Customized GraphQLHttpConfiguration adding the operation to the URL",
203+
"anchorId" : "customizing-the-graphql-endpoint-customized-graphqlhttpconfiguration-adding-the-operation-to-the-url",
202204
"type" : "Snippet"
203205
} ]
204206
} ],
205-
"lastModifiedTime" : 1658346107238,
207+
"lastModifiedTime" : 1670451504498,
206208
"tocItem" : {
207-
"sectionTitle" : "GraphQL",
209+
"chapterTitle" : "GraphQL",
208210
"pageTitle" : "Customized Graphql Urls",
209211
"pageMeta" : { },
210212
"dirName" : "GraphQL",

GraphQL/introduction/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@
108108
"type" : "Guide",
109109
"previewEnabled" : false,
110110
"support" : {
111-
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
111+
"link" : "https://github.com/testingisdocumenting/webtau/discussions",
112+
"title" : "GitHub"
112113
}
113114
},
114115
"page" : {
@@ -139,11 +140,13 @@
139140
"lang" : "groovy",
140141
"snippet" : "package scenarios.rest\n\nimport static org.testingisdocumenting.webtau.WebTauGroovyDsl.*\n\nscenario(\"check weather\") {\n def query = \"{ weather { temperature } }\";\n graphql.execute(query) {\n weather.temperature.shouldBe < 100\n }\n}",
141142
"title" : "GraphQL API test (Groovy specific runner)",
143+
"anchorId" : "graphql-api-test-groovy-specific-runner",
142144
"type" : "Snippet"
143145
}, {
144146
"lang" : "groovy",
145147
"snippet" : "package com.example.tests.junit4\n\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.testingisdocumenting.webtau.junit4.WebTauRunner\n\nimport static org.testingisdocumenting.webtau.WebTauDsl.graphql\n\n@RunWith(WebTauRunner.class)\nclass GraphQLWeatherGroovyIT {\n @Test\n void checkWeather() {\n def query = \"{ weather { temperature } }\";\n graphql.execute(query) {\n weather.temperature.shouldBe < 100\n }\n }\n}",
146148
"title" : "GraphQL API test (JUnit4)",
149+
"anchorId" : "graphql-api-test-junit4",
147150
"type" : "Snippet"
148151
} ]
149152
}, {
@@ -171,6 +174,7 @@
171174
"lang" : "java",
172175
"snippet" : "package com.example.tests.junit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.testingisdocumenting.webtau.junit4.WebTauRunner;\n\nimport static org.testingisdocumenting.webtau.WebTauDsl.*;\n\n@RunWith(WebTauRunner.class)\npublic class GraphQLWeatherJavaIT {\n @Test\n public void checkWeather() {\n String query = \"{ weather { temperature } }\";\n graphql.execute(query, (header, body) -> {\n body.get(\"data.weather.temperature\").shouldBe(lessThan(100));\n });\n }\n}",
173176
"title" : "GraphQL API test (JUnit4 Java)",
177+
"anchorId" : "graphql-api-test-junit4-java",
174178
"type" : "Snippet"
175179
} ]
176180
}, {
@@ -268,9 +272,9 @@
268272
} ]
269273
} ]
270274
} ],
271-
"lastModifiedTime" : 1658346107238,
275+
"lastModifiedTime" : 1670451504498,
272276
"tocItem" : {
273-
"sectionTitle" : "GraphQL",
277+
"chapterTitle" : "GraphQL",
274278
"pageTitle" : "Introduction",
275279
"pageMeta" : { },
276280
"dirName" : "GraphQL",

GraphQL/queries-and-mutations/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@
114114
"type" : "Guide",
115115
"previewEnabled" : false,
116116
"support" : {
117-
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
117+
"link" : "https://github.com/testingisdocumenting/webtau/discussions",
118+
"title" : "GitHub"
118119
}
119120
},
120121
"page" : {
@@ -242,6 +243,7 @@
242243
"snippet" : "package scenarios.graphql\n\nimport static org.testingisdocumenting.webtau.WebTauGroovyDsl.*\n\ndef listAllQuery = '''\n{\n allTasks(uncompletedOnly: false) {\n id\n description\n }\n}\n'''\n\ndef taskByIdQuery = '''\nquery taskById($id: ID!) {\n taskById(id: $id) {\n id\n description\n completed\n }\n}\n'''\n\ndef completeMutation = '''\nmutation complete($id: ID!) {\n complete(id: $id)\n}\n'''\n\nscenario(\"list all tasks\") {\n graphql.execute(listAllQuery) { // Execute a simple query with no variables\n errors.should == null // Validate there were no errors\n body.data.allTasks.id.should == [\"a\", \"b\", \"c\"] // Access response data with the full path\n allTasks.id.should == [\"a\", \"b\", \"c\"] // Access response data via a shortcut allowing omitting of `body.data`\n id.should == [\"a\", \"b\", \"c\"] // For single query requests, access response data via a shortcut allowing omitting of `body.data` and the query name\n }\n}\n\nscenario(\"complete a task\") {\n graphql.execute(completeMutation, [id: \"a\"]) { // Execute a mutation with a variables map\n errors.should == null\n complete.should == true\n }\n\n graphql.execute(taskByIdQuery, [id: \"a\"]) {\n errors.should == null\n taskById.id.should == \"a\"\n taskById.completed.should == true\n }\n}\n\nscenario(\"cannot complete a completed task\") {\n graphql.execute(completeMutation, [id: \"b\"]) { // Execute a mutation with a variables map\n errors.should == null\n complete.should == true\n }\n graphql.execute(completeMutation, [id: \"b\"]) { // force an error\n errors[0].message.shouldNot == null\n complete.should == null\n }\n}",
243244
"title" : "GraphQL example with a query, a mutation and variables",
244245
"commentsType" : "inline",
246+
"anchorId" : "executing-queries-and-mutations-graphql-example-with-a-query-a-mutation-and-variables",
245247
"type" : "Snippet"
246248
} ]
247249
}, {
@@ -279,9 +281,9 @@
279281
} ]
280282
} ]
281283
} ],
282-
"lastModifiedTime" : 1658346107238,
284+
"lastModifiedTime" : 1670451504498,
283285
"tocItem" : {
284-
"sectionTitle" : "GraphQL",
286+
"chapterTitle" : "GraphQL",
285287
"pageTitle" : "Queries And Mutations",
286288
"pageMeta" : { },
287289
"dirName" : "GraphQL",

0 commit comments

Comments
 (0)