Created
March 14, 2022 21:09
-
-
Save mateomurphy/7fc3ae4d10ff447fdb42955f805fbb88 to your computer and use it in GitHub Desktop.
Revisions
-
mateomurphy revised this gist
Mar 14, 2022 . No changes.There are no files selected for viewing
-
mateomurphy created this gist
Mar 14, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import { withScalars } from 'apollo-link-scalars' import { buildClientSchema, IntrospectionQuery } from 'graphql' import introspectionResult from '../graphql/schema.json' const typesMap = { ISO8601DateTime: { serialize: (parsed: any) => parsed && parsed.toISOString(), parseValue: (raw: any) => raw && new Date(raw), }, } const schema = buildClientSchema( (introspectionResult as unknown) as IntrospectionQuery ) const scalarsLink = withScalars({ schema, typesMap, }) export default scalarsLink