Skip to content

Instantly share code, notes, and snippets.

@ilgityildirim
Forked from sc0ttdav3y/_aws.graphql
Created July 22, 2021 09:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilgityildirim/31fb9e917d495d0afd383eb3d8d9c2fc to your computer and use it in GitHub Desktop.
Save ilgityildirim/31fb9e917d495d0afd383eb3d8d9c2fc to your computer and use it in GitHub Desktop.
AWS AppSync GraphQL scalars and directives to support type completion and error checking in Webstorm IDEs
# These are here to help the IDE recognise AWS types.
#
# Place this file outside the 'schema' directory so are not pushed to AWS,
# but are still picked up by PhpStorm's GraphQL plugin to help
# validate schemas.
#
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html
#
scalar AWSDateTime
scalar AWSDate
scalar AWSTime
scalar AWSTimestamp
scalar AWSEmail
scalar AWSJSON
scalar AWSURL
scalar AWSPhone
scalar AWSIPAddress
#
# The below directives came from a GitHub issue here:
# https://github.com/apollographql/eslint-plugin-graphql/issues/263
#
"""This directive allows results to be deferred during execution"""
directive @defer on FIELD
"""
Tells the service this field/object has access authorized by an OIDC token.
"""
directive @aws_oidc on OBJECT | 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 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
"""
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
"""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 this field/object has access authorized by an API key.
"""
directive @aws_api_key on OBJECT | FIELD_DEFINITION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment