Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve output-type System.DateTime #530

Closed
OneCyrus opened this issue Jan 24, 2019 · 6 comments
Closed

Cannot resolve output-type System.DateTime #530

OneCyrus opened this issue Jan 24, 2019 · 6 comments
Labels
📚 documentation This issue is about working on our documentation. ❓ question This issue is a question about feature of Hot Chocolate.
Milestone

Comments

@OneCyrus
Copy link
Contributor

Describe the bug
there looks to be a regression with 0.7.0 (alpha.34) after upgrading from 0.6.11.

To Reproduce
we get the following error

HotChocolate.SchemaException: 'testGraphQuery.date: Cannot resolve output-type `System.DateTime` - Type: TestGraphQuery'

with registering this simple type (c.RegisterQueryType<TestGraphQuery>())

public class TestGraphQuery
    {
        public string Version { get; set; } = "0.0.1-alpha.1";
        public DateTime Date { get; set; } = DateTime.Now;
    }

Expected behavior
with 0.6.11 we get a Date GraphType

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 0.7.0 (alpha 34)
@scottrabara
Copy link
Contributor

scottrabara commented Jan 24, 2019

Hi Daniel,

There were some changes done for #433 made to address custom extended scalars. Since then, the stock built-in extended scalars must now be explicitly registered during schema configuration if you do not intend to override them:

var schema = Schema.Create(c =>
{
    // Register all 6 pre-built extended scalar types
    c.RegisterExtendedScalarTypes();
});

or

var schema = Schema.Create(c =>
{
    // Register only pre-built date time type
    c.RegisterType<DateTimeType>();
});

@scottrabara
Copy link
Contributor

scottrabara commented Jan 24, 2019

Perhaps I can add a migration section in the Scalar Type Support documentation to make light of this situation @michaelstaib

@OneCyrus
Copy link
Contributor Author

oh good to know. thanks!

@michaelstaib michaelstaib added the ❓ question This issue is a question about feature of Hot Chocolate. label Jan 24, 2019
@michaelstaib
Copy link
Member

Hey @scottrabara, that is a good point ...

but let's create a separate section and put all migration steps there since we have another breaking change with the DataLoader.

@michaelstaib michaelstaib added the 📚 documentation This issue is about working on our documentation. label Jan 24, 2019
@michaelstaib michaelstaib added this to the 0.7.0 milestone Jan 24, 2019
@michaelstaib
Copy link
Member

@OneCyrus thanks for reporting this one

@michaelstaib
Copy link
Member

This one is now done .... https://hotchocolate.io/docs/next/migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation This issue is about working on our documentation. ❓ question This issue is a question about feature of Hot Chocolate.
Projects
None yet
Development

No branches or pull requests

3 participants