-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'graphql-scalars': patch | ||
--- | ||
|
||
Introduce DateTimeISO scalar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; | ||
import { GraphQLDateTimeConfig } from './DateTime.js'; | ||
|
||
export const GraphQLDateTimeISOConfig: GraphQLScalarTypeConfig<Date, string> = /*#__PURE__*/ { | ||
...GraphQLDateTimeConfig, | ||
name: 'DateTimeISO', | ||
description: | ||
'A date-time string at UTC, such as 2007-12-03T10:15:30Z, ' + | ||
'compliant with the `date-time` format outlined in section 5.6 of ' + | ||
'the RFC 3339 profile of the ISO 8601 standard for representation ' + | ||
'of dates and times using the Gregorian calendar.' + | ||
'This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.', | ||
serialize(value) { | ||
const date = GraphQLDateTimeConfig.serialize(value); | ||
return date.toISOString(); | ||
}, | ||
}; | ||
|
||
export const GraphQLDateTimeISO = /*#__PURE__*/ new GraphQLScalarType(GraphQLDateTimeISOConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters