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

createdAt not included in schema.graphql #57

Open
ZachCMP opened this issue Mar 10, 2019 · 2 comments
Open

createdAt not included in schema.graphql #57

ZachCMP opened this issue Mar 10, 2019 · 2 comments

Comments

@ZachCMP
Copy link

ZachCMP commented Mar 10, 2019

Hey,

Thanks for the great tutorial, it was very helpful in learning GraphQL. I actually started the React tutorial first, then decided to come and do this one, as the React one uses this same backend. I thought it would be a much better learning experience to build the backend tutorial first, then use that backend code to build the frontend tutorial. However, I hit a stumbling block immediately upon trying to use my backend code:

In this tutorial, the Link { createdAt } field is only used in the Prisma schema, not in the main API schema. If you download the server starter code listed in the React tutorial, it is is correctly listed in both schemas.

Further, the createdAt type is DateTime, which doesn't seem to be a standard GraphQL type. Using it requires that you declare "scalar DateTime" at the top of your API schema (as seen in the React tut starter). Doing that worked for me with no additional dependencies, but I have no idea why.

Some more clarity on that within the tutorial would be helpful.

@jaromb
Copy link

jaromb commented May 20, 2019

I'll second this. In the backend tutorial for Node, "type Link" in the schema.graphql file is missing the "createdAt:" field, which results in an error when trying to go through the first steps for the front-end tutorial for React+Apollo. I was able to fix the problem by adding that field as follows:
createdAt: String!

This should be added as a step after adding the "createdAt" field in the datamodel, as is done in the other steps (modifying the schema in addition to modifying the datamodel) in order to keep all aspects of the schema in agreement with the datamodel.

@eseku
Copy link

eseku commented Jun 5, 2024

Just coming accross this problem as well. I guess I would use the starter code as a reference. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants