Replies: 1 comment
-
Not sure it will be exactly what you want, but this is how I resolved it in my case: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are a few issues and discussions on how to use this package together with
@graphql-codegen/cli
(docs, repo).scalars:
config like you can for enumValues dotansimha/graphql-code-generator#2418Together, these issues and discussions are fundamentally trying to achieve the same objective: typed scalars.
Given the flexibility of this ecosystem, there's more than one way to do this. However, it seems that there are no concrete examples or docs for popular workflows. Specifically,
1. How to use the
codegenScalarType
to generate typed scalars?There seems to be no concrete, step-by-step examples on how to do this.
2. When using SDL, how to link
graphql-scalars
' types into@graphql-codegen/cli
When using SDL, seems that the only way to obtain typed scalars with
@graphql-codegen/cli
is to manually set their type in.graphqlrc.yaml
,Furthermore, it feels weird that an executable schema can be created by combining project-specific definitions and library definitions, but can't be done for code generation. Let me illustrate,
However, when using
@graphql-codegen/cli
, how canDateTime
be injected into the generation process?The best I've been able to come up with, is to re-declare
scalar DateTime
in the project's ownschema.graphql
, although this is technically redundant. But it works.Regardles, best practices and guidance is what I'm after. Is this 👆 the best way to include scalars into the code generation process?
Beta Was this translation helpful? Give feedback.
All reactions