Search Results for

    Show / Hide Table of Contents

    Building GraphQL Queries

    This document descrbies how to build a GraphQL query. The following image shows a sample query for creating a task group in Exacta Maestro™. The numbers in red label a component of the query, described in the following list.

    Sample GraphQL Query

    1. Operation type. Either query or mutation. This can be omitted if the query document contains exactly one operation which is a query.

    2. Operation name. An arbitrary name describing the query to run. This can be omitted if the query document contains exactly one operation.

    3. Variable name. An arbitrary name describing a variable to use elsewhere in the query. Values for variables are provided by at runtime as a set of key-value pairs, usually JSON. If a variable is defined on the operation, it must be used in the query.

    4. Variable type. Sets the type of the variable. This must be a GraphQL input type or scalar available in the schema.

    5. Exacta Maestro™ service field. The top-level fields of all Exacta Maestro™ queries define the service targeted by all sub-field selections. These always take the form {serviceName}Query or {serviceName}Mutation.

    6. Exacta Maestro™ operation. Sub-fields directly below the Exacta Maestro™ service field describe an operation to get or set some data within Exacta Maestro™.

    7. Sub-field selections. If an operation returns a type rather than a scalar, the user must declare which fields of that type to return. A sub-field may itself be a type requiring additional subfield selections.

    8. Field argument. Many Exacta Maestro™ fields require arguments to filter results or describe data to add to the system. GraphQL supports this through arguments.

    9. Variable usage. Values for arguments can be provided as variables or GraphQL literal values.

    Other GraphQL Constructs

    This document provided a subset of common GraphQL query features. Additional concepts not covered here include:

    • Aliases
    • Fragments
    • Directives
    In This Article