Custom Scalars?
See original GitHub issueIn Typescript, custom scalar types are emitted like:
export type Foo = any;
How can I make the emitted Foo refer to my existing types?
For example, if somewhere else in my code base, I have:
class Foo {
bar: string
someMethod() {
...
}
}
I know this supports templating, but even with templating, I’m not sure how to make Foo in the generated types refer to my project’s Foo. It seems like I’d need to import existing scalar definitions into my schema template? Or I’d need to define all my custom scalars in templates? Both of these sound pretty unmaintainable. Is there some convenient way to do this? Or is there an example for solving this sort of problem?
PS. Thank you for this package!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:31 (11 by maintainers)
Top Results From Across the Web
Custom scalars - Apollo GraphQL Docs
Custom scalars. The GraphQL specification includes default scalar types Int , Float , String , Boolean , and ID ...
Read more >Custom Scalars and Enums – GraphQL Tools
Add custom scalar and enum types to your graphql-tools generated schema.
Read more >A library of custom GraphQL Scalars for creating ... - GitHub
A library of custom GraphQL scalar types for creating precise type-safe GraphQL schemas. Getting Started. Please refer to our website for all the...
Read more >StepZen's Custom GraphQL Scalar Types
Built-in GraphQL Scalar Types ; Int: Signed 32‐bit integer. ; Float: Signed double-precision, floating-point value. ; String: UTF‐8 character sequence. ; Boolean: ...
Read more >Custom Scalars - Lacinia - Read the Docs
Read about custom scalars. To define a custom scalar, you must provide implementations, in your schema, for two transforming callback functions: parse: parses ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use mappers format for scalars, we use it in other places as well, should look like that:
@dotansimha I’m new to this plugin, could you share what
my-file
looks like?