Giter Club home page Giter Club logo

hotchocolate-nodatime's Introduction

⚠️ Warning

This repository has been absorbed into Hot Chocolate.

The corresponding Nuget package HotChocolate.Types.NodaTime is now managed by ChilliCream.

See this PR for reference.


Introduction

Adds support for NodaTime types in Hot Chocolate.

Usage

.NET Core

Install the package from NuGet:

dotnet add package HotChocolate.Types.NodaTime

Call AddNodaTime on your schema builder like so:

SchemaBuilder.New()
    // ...
    .AddNodaTime()
    .Create();

Documentation

DateTimeZone

Format: One Zone ID from these

Literal example: "Europe/Rome"

References:

Duration

Literal example: "-123:07:53:10.019"

References:

Instant

Literal example: "2020-02-20T17:42:59Z"

References:

IsoDayOfWeek

Literal example: 7

References:

LocalDate

Literal example: "2020-12-25"

References:

LocalDateTime

Literal example: "2020-12-25T13:46:78"

References:

LocalDateTime

Literal examples:

  • "12:42:13"
  • "12:42:13.03101"

References:

OffsetDateTime

Literal examples:

  • "2020-12-25T13:46:78+02"
  • "2020-12-25T13:46:78+02:35"

References:

OffsetDate

Literal examples:

  • "2020-12-25+02"
  • "2020-12-25+02:35"

References:

OffsetTime

Literal examples:

  • "13:46:78+02"
  • "13:46:78+02:35"

References:

Offset

Literal examples:

  • "+02"
  • "+02:35"

References:

Period

Literal examples:

  • "P-3W3D"
  • "PT139t"
  • "P-3W3DT139t"

References:

ZonedDateTime

There's nothing close to a standard for timezoned date-times. Therefore this library chooses to follow the order of the ZonedDateTime constructor and define a format with a LocalDateTime pattern followed by a timezone ID followed by an offset. Feel free to override this behavior.

Literal examples:

  • "2020-12-31T18:30:13 UTC +00"
  • "2020-12-31T19:40:13 Europe/Rome +01"
  • "2020-12-31T19:40:13 Asia/Kathmandu +05:45"

References:

hotchocolate-nodatime's People

Contributors

benmccallum avatar sfmskywalker avatar shoooe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hotchocolate-nodatime's Issues

Crash on .AddNodaTime()

When I call the function AddNodaTIme I receive this error:
services .AddGraphQLServer() //// .ConfigureSchema(x => x.AddNodaTime());

System.TypeLoadException
HResult=0x80131522
Message=Method 'get_RuntimeType' in type 'HotChocolate.Types.NodaTime.DateTimeZoneType' from assembly 'HotChocolate.Types.NodaTime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Source=HotChocolate.Types.NodaTime
StackTrace:
at HotChocolate.Types.NodaTime.Extensions.ISchemaBuilderExtensions.AddNodaTime(ISchemaBuilder schemaBuilder)
at webstep.Startup.<>c.b__4_1(ISchemaBuilder x) in C:\Users\Test\Bachelor\webstep\webstep\Startup.cs:line 70
at Microsoft.Extensions.DependencyInjection.RequestExecutorBuilderExtensions.<>c__DisplayClass0_0.b__1(IServiceProvider sp, ISchemaBuilder sb)
at HotChocolate.Execution.RequestExecutorResolver.d__14.MoveNext()

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.