-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How would you import directives/etc from AWS AppSync while using basic .graphql schema #263
Comments
As per awslabs/aws-mobile-appsync-sdk-js#547 (comment), it seems we can get a minimal
"""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 I was then able to configure my {
"schemaPath": "schema.graphql",
"includes": ["aws-directives.graphql"]
} This appears to allow eslint to work correctly. When I remove the
|
What isn't clear to me now, is how I would go about supporting this with the legacy |
According to JetBrains/js-graphql-intellij-plugin#114 it sounds like maybe I should make it a |
Using AWS AppSync you can export both a
.graphql
schema, and a full.json
schema.The
.graphql
is your basic actual definitions:Whereas the
.json
includes all of the AWS specifics, as well as the basics from my.graphql
schema:schema.json.txt
Ideally I would like to be able to use the main
.graphql
file for simplicity, and include the AWS AppSync specifics from another external file (so that I don't get 'undefined directive' errors and similar)When I just use the
.graphql
schema I end up with errors such as:Not sure of a good source for the full AWS AppSync specifics.. but when googling for things these pages sounded interesting:
The text was updated successfully, but these errors were encountered: