The GraphQL Schema Validation policy applies standard GraphQL validation rules, including field and argument correctness, fragments, directives, unions, interfaces, and other specification rules.
The policy loads the schema in these ways:
-
If source is context, Flex Gateway automatically loads the schema file from the API asset in Anypoint Exchange.
-
If source is inline, provide the schema text directly in the policy configuration. This is required for local mode or environments not connected to Exchange.
If the document includes an @link to the Apollo Federation specification URL, Omni Gateway uses this schema to validate all incoming requests.
After Omni Gateway extracts inline GraphQL operation text from the request, the policy runs validation. If Omni Gateway can’t resolve normal operation text, such as persisted query flows, it skips these checks and logs a warning before it forwards the request to the upstream.