Comments (1)
You can create a local file with the AWS scalars and include it in your schema:
$ > graphql-schema-utilities -s "{aws/types.graphql,schema.graphql,schema/**/*.graphql}"
# aws/types.graphql
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html#appsync-defined-scalars
"""
The AWSDate scalar type represents a valid extended ISO 8601 Date string. In other words, this scalar type accepts date strings of the form YYYY-MM-DD. This scalar type can also accept time zone offsets. For example, 1970-01-01Z, 1970-01-01-07:00 and 1970-01-01+05:30 are all valid dates. The time zone offset must either be Z (representing the UTC time zone) or be in the format ±hh:mm:ss. The seconds field in the timezone offset will be considered valid even though it is not part of the ISO 8601 standard.
"""
scalar AWSDate
"""
The AWSTime scalar type represents a valid extended ISO 8601 Time string. In other words, this scalar type accepts time strings of the form hh:mm:ss.sss. The field after the seconds field is a nanoseconds field. It can accept between 1 and 9 digits. The seconds and nanoseconds fields are optional (the seconds field must be specified if the nanoseconds field is to be used). This scalar type can also accept time zone offsets.
For example, 12:30Z, 12:30:24-07:00 and 12:30:24.500+05:30 are all valid time strings.
The time zone offset must either be Z (representing the UTC time zone) or be in the format hh:mm:ss. The seconds field in the timezone offset will be considered valid even though it is not part of the ISO 8601 standard.
"""
scalar AWSTime
"""
The AWSDateTime scalar type represents a valid extended ISO 8601 DateTime string. In other words, this scalar type accepts datetime strings of the form YYYY-MM-DDThh:mm:ss.sssZ. The field after the seconds field is a nanoseconds field. It can accept between 1 and 9 digits. The seconds and nanoseconds fields are optional (the seconds field must be specified if the nanoseconds field is to be used). The time zone offset is compulsory for this scalar. The time zone offset must either be Z (representing the UTC time zone) or be in the format ±hh:mm:ss. The seconds field in the timezone offset will be considered valid even though it is not part of the ISO 8601 standard.
"""
scalar AWSDateTime
"""
The AWSTimestamp scalar type represents the number of seconds that have elapsed since 1970-01-01T00:00Z. Timestamps are serialized and deserialized as numbers. Negative values are also accepted and these represent the number of seconds till 1970-01-01T00:00Z.
"""
scalar AWSTimestamp
"""
The AWSEmail scalar type represents an Email address string that complies with RFC 822. For example, [email protected] is a valid Email address.
"""
scalar AWSEmail
"""
The AWSJSON scalar type represents a JSON string that complies with RFC 8259.
Maps like {\"upvotes\": 10}, lists like [1,2,3], and scalar values like \"AWSJSON example string\", 1, and true are accepted as valid JSON. They will automatically be parsed and loaded in the resolver mapping templates as Maps, Lists, or Scalar values rather than as the literal input strings. Invalid JSON strings like {a: 1}, {'a': 1} and Unquoted string will throw GraphQL validation errors.
"""
scalar AWSJSON
"""
The AWSURL scalar type represents a valid URL string. The URL may use any scheme and may also be a local URL (Ex: <http://localhost/>). URLs without schemes are considered invalid. URLs which contain double slashes are also considered invalid.
"""
scalar AWSURL
"""
The AWSPhone scalar type represents a valid Phone Number. Phone numbers are serialized and deserialized as Strings. Phone numbers provided may be whitespace delimited or hyphenated. The number can specify a country code at the beginning but this is not required.
"""
scalar AWSPhone
"""
The AWSIPAddress scalar type represents a valid IPv4 or IPv6 address string.
"""
scalar AWSIPAddress
from graphql-schema-utilities.
Related Issues (18)
- 1.1.0-beta.0: "undefined" keyword is showing in the merged schema when none of the input schema files has the schema definition. HOT 1
- 1.1.0-beta.0: graphql comments are being deleted in the merged schema if you are using # instead of """ HOT 2
- directives are not being added to the merged schema file. HOT 1
- Programmatic access to mergeGQLSchemas is not exported.
- Errors when using LIST of mutations in @aws_subscribe HOT 3
- make the tsconfig more strict
- Test issue
- Empty type Query as mentioned in example not possible HOT 5
- @aws_subscribe directive is missing in merged schema HOT 1
- AppSync reject directive definition saying "Directive definitions are not supported." HOT 8
- Allow --quiet / --silent option to the CLI
- Multiple implements throws Syntax error HOT 1
- Add an option to remove comments from the source files
- Show error message when merging fails
- AppSync supports multi interface implementation while this tool does not
- Warning about graphql version during installation
- 1.1.0-beta.0: directives defined under the "extended" types are not showing in the merged schema. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-schema-utilities.