Skip to content

Instantly share code, notes, and snippets.

@revmischa
Created December 7, 2024 01:00
Show Gist options
  • Save revmischa/7cff6dafc10e7629252ae3475339f183 to your computer and use it in GitHub Desktop.
Save revmischa/7cff6dafc10e7629252ae3475339f183 to your computer and use it in GitHub Desktop.
AWS AppSync GraphQL Directives
# top secret AppSync GQL directives AWS doesn't want you to know about!
scalar AWSDate
scalar AWSTime
scalar AWSDateTime
scalar AWSTimestamp
scalar AWSEmail
scalar AWSJSON
scalar AWSURL
scalar AWSPhone
scalar AWSIPAddress
"""
This directive allows results to be deferred during execution
"""
directive @defer on FIELD
"""
Indicates that the schema is allowed to be further processed by supported type/field-level directives.
"""
directive @aws_transform on SCHEMA
"""
Tells the service this field/object has access authorized by an OIDC token.
"""
directive @aws_oidc on OBJECT | FIELD_DEFINITION
"""
Tells the service which mutation triggers this subscription.
"""
directive @aws_subscribe(
"""
List of mutations which will trigger this subscription when they are called.
"""
mutations: [String]
) on FIELD_DEFINITION
"""
Tells the service this field/object has access authorized by sigv4 signing.
"""
directive @aws_iam on OBJECT | FIELD_DEFINITION
"""
Tells the service which subscriptions will be published to when this mutation is
called. This directive is deprecated use @aws_susbscribe directive instead.
"""
directive @aws_publish(
"""
List of subscriptions which will be published to when this mutation is called.
"""
subscriptions: [String]
) on FIELD_DEFINITION
"""
Directs the schema to enforce authorization on a field
"""
directive @aws_auth(
"""
List of cognito user pool groups which have access on this field
"""
cognito_groups: [String]
) on FIELD_DEFINITION
"""
Tells the service this field/object has access authorized by an API key.
"""
directive @aws_api_key on OBJECT | FIELD_DEFINITION
"""
Tells the service this field/object has access authorized by a Lambda Authorizer.
"""
directive @aws_lambda on OBJECT | FIELD_DEFINITION
"""
Tells the service this field/object has access authorized by a Cognito User Pools token.
"""
directive @aws_cognito_user_pools(
"""
List of cognito user pool groups which have access on this field
"""
cognito_groups: [String]
) on OBJECT | FIELD_DEFINITION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment