postGraphGraphql method
Ask the graph in one request, traversing.
Runs a GraphQL query against this organization's assertions. It is the one endpoint here a caller can TRAVERSE: the REST ops each answer a single question, so composing them — the entities this one points at, and what each of those resolves to — costs a request per hop with the intermediate keys held by the caller. Here that is one query and the nesting is the answer's shape. It adds no way to ask anything new. Every field runs the SAME operation the matching REST route runs, so the tenancy, the as-of bound, the traversal bounds and the conflict rule are the ones already in force; the schema is served by introspection. A query that cannot run answers 200 with an errors list, which is the wire every GraphQL client parses.
Parameters:
- GraphQLIn graphQLIn:
Implementation
Future<GraphQLOut?> postGraphGraphql({ GraphQLIn? graphQLIn, }) async {
final response = await postGraphGraphqlWithHttpInfo( graphQLIn: graphQLIn, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GraphQLOut',) as GraphQLOut;
}
return null;
}