Giter Club home page Giter Club logo

Comments (8)

byme8 avatar byme8 commented on August 30, 2024 2

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.

from zeroql.

byme8 avatar byme8 commented on August 30, 2024 1

At the moment, there is not support for custom scalar types. I will have a look at it.

from zeroql.

byme8 avatar byme8 commented on August 30, 2024 1

@ahanoff Checkout v2.1.0

from zeroql.

ahanoff avatar ahanoff commented on August 30, 2024

https://chillicream.com/docs/strawberryshake/scalars/#custom-scalars
By default, all custom scalars are treated like the String scalar. This means, that the client expects a string value and will deserialize it to a System.String.

thanks @byme8, btw this is how Strawberry Shake client treats custom scalars. Maybe it gives you some ideas

from zeroql.

DaveRMaltby avatar DaveRMaltby commented on August 30, 2024

Should a schema that contains a TimeSpan start failing after upgrading to v2.1.0? I am going to try to follow your readme and make a custom scalar for System.TimeSpan If this works, I would like to create an issue for it and suggest that it be natively supported by ZeroQL.

from zeroql.

DaveRMaltby avatar DaveRMaltby commented on August 30, 2024

You rock! Thanks.

from zeroql.

byme8 avatar byme8 commented on August 30, 2024

@DaveRMaltby Starting from v3.3.0-preview.2 the System.TimeSpan is properly bootstrapped.

from zeroql.

DaveRMaltby avatar DaveRMaltby commented on August 30, 2024

@byme8, great! Thank you sir. I'll take advantage of it.

from zeroql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.