question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for custom scalars

See original GitHub issue

GraphQL.g.cs(6110, 36): [CS0246] The type or namespace name ‘ObjectId’ could not be found (are you missing a using directive or an assembly reference?)

in schema it looks like:

scalar ObjectId

Does it support custom scalars? I’ve generated client from schema that uses Mongo ObjectId, and got this error

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
byme8commented, Oct 30, 2022

At the moment, it will fail. It is not bootstrapped correctly in the library. It is possible to define it as a custom scalar, but it would be much better to handle it as a system type.

I already started working on it and noticed that HotChocolate and System.Text.Json serialize System.TimeSpan in different formats. So, I plan to add a more robust way to tinker with JSON serialization in the library.

1reaction
byme8commented, Oct 29, 2022

@ahanoff Checkout v2.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom scalars - Apollo GraphQL Docs
GraphQL includes the following scalar types by default: Int , Float , String , Boolean , and ID . You can also define...
Read more >
Support for custom scalars · Issue #585 - GitHub
After speaking with @glasser, I noticed that we don't currently have great support for custom scalar types on Apollo Client.
Read more >
Custom Scalars and Enums – GraphQL Tools
Custom Scalar Examples. Let's look at a couple of examples to demonstrate how a custom scalar type can be defined. Date as a...
Read more >
Adding Custom Scalars - DGS Framework
It is easy to add a custom scalar type in the DGS framework: Create a class that implements the graphql.schema.Coercing interface and annotate...
Read more >
Scalar types in AWS AppSync
AWS AppSync does not support custom scalars. This means that you cannot use AWS as a prefix for custom object types. The following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found