Package org.mockserver.model
Class GraphQLBody
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionGraphQLBody(String query) GraphQLBody(String query, String operationName, String variablesSchema) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetQuery()The GraphQL schema (SDL text or an introspection JSON result) associated with this expectation.getValue()static GraphQLBodystatic GraphQLBodystatic GraphQLBodyinthashCode()toString()withFields(String... fields) withFields(List<String> fields) withSchema(String schema) Register a GraphQL schema (SDL text or an introspection JSON result) on this body so that schema-valid responses can be synthesized for matched queries.withSelectionSetMatchType(SelectionSetMatchType selectionSetMatchType) Methods inherited from class org.mockserver.model.Body
getCharset, getContentType, getOptional, getRawBytes, getType, withOptionalMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
GraphQLBody
-
GraphQLBody
-
-
Method Details
-
graphQL
-
graphQL
-
graphQL
-
getQuery
-
getOperationName
-
getVariablesSchema
-
getSelectionSetMatchType
-
withSelectionSetMatchType
-
getSchema
The GraphQL schema (SDL text or an introspection JSON result) associated with this expectation. When present, MockServer can synthesize a schema-valid response for a matched query without any hand-authored response JSON.- Returns:
- the SDL/introspection schema, or
nullif none is registered
-
withSchema
Register a GraphQL schema (SDL text or an introspection JSON result) on this body so that schema-valid responses can be synthesized for matched queries.- Parameters:
schema- SDL text (e.g."type Query { hello: String }") or an introspection JSON result (thedata.__schemaor full envelope)- Returns:
- this body for fluent chaining
-
getFields
-
withFields
-
withFields
-
getValue
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classObjectWithJsonToString
-