Custom scalar that maps to arbitrary type? #6181
-
Hello, I'm wondering if there's a way to use config:
scalars:
Foo: MyExoticScalar # not just `any`, or `string`, etc. But when compiled,
Alternatively, if I omit the config:
scalars:
Foo: any ...which is unappealing for reasons of being weakly typed. Is there some |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@spencerwilson sure! we support a format like this: scalars:
Upload: 'graphql-upload#FileUpload' (it's In more complex use-cases, you can use the identifier name and use config:
MyGqlType: 'A'
plugins:
- add:
content: "import A from 'somewhere'";
- typescript |
Beta Was this translation helpful? Give feedback.
@spencerwilson sure! we support a format like this:
(it's
PACKAGE_NAME#IDENTIFIER_NAME
)In more complex use-cases, you can use the identifier name and use
add
plugin, for example: