Is there a way to make fields of a special scalar type to be converted to date objects by graphql-request
? Not just alias type, but have Date object, like Apollo can do with resolvers?
Here's my codegen.ts file:
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: './my-schema.graphql',
documents: ['src', '!src/graphql'],
generates: {
'./schema.graphql': {
plugins: ['schema-ast'],
},
'src/gql/': {
preset: 'client',
plugins: [
'typescript-operations',
],
config: {
scalars: {
UUID: 'string',
LocalDateTime: 'Date', // here: how to convert this scalar to Date?
},
},
},
},
};
I've tried typescript-resolvers
plugin, but it is used to create a resolvers object, which doesn't seem to be of any use for graphql-request
.