Directives
GraphQL directives supported by Navixy GraphQL API, including standard directives and the custom @trim directive.
Directives modify the behavior of fields, types, or operations in a GraphQL schema. They are prefixed with @ and can be applied at various locations.
Standard directives
These directives are part of the GraphQL specification and available in all queries.
@skip
Conditionally excludes a field or fragment from the response.
if
Boolean!
When true, the field is excluded from the response.
Locations: FIELD, FRAGMENT_SPREAD, INLINE_FRAGMENT
Example:
query GetDevice($skipIdentifiers: Boolean!) {
bdr {
device(id: "123") {
title
identifiers @skip(if: $skipIdentifiers) {
type
value
}
}
}
}@include
Conditionally includes a field or fragment in the response.
if
Boolean!
When true, the field is included in the response.
Locations: FIELD, FRAGMENT_SPREAD, INLINE_FRAGMENT
Example:
@deprecated
Marks a field or enum value as deprecated, signaling that it should no longer be used.
reason
String
Explanation of why it's deprecated and what to use instead.
Locations: FIELD_DEFINITION, ARGUMENT_DEFINITION, INPUT_FIELD_DEFINITION, ENUM_VALUE
Example:
@specifiedBy
Provides a URL to a specification that defines the behavior of a custom scalar.
url
String!
URL to the scalar specification document.
Locations: SCALAR
Example:
@oneOf
Indicates that an input object requires exactly one of its fields to be provided. This is useful for creating union-like input types.
Locations: INPUT_OBJECT
Example:
Custom directives
These directives are specific to the Navixy GraphQL API.
@trim
Automatically trims leading and trailing whitespace from string input values.
Locations: INPUT_FIELD_DEFINITION, ARGUMENT_DEFINITION
Last updated
Was this helpful?