-
Notifications
You must be signed in to change notification settings - Fork 4
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
[GraphQL Basics course] [Main Task] [Sanchit] #7
Comments
Okay, working on it! :) |
As you more familiar with our github workflow, please start reading first chapters asap and put here your progress. I think this will motivate our other team members to start a race. just a little competition does not harm, right? let's this will be our secret :) |
Please add me as a collaborator to this one @atherdon. For now I have forked this repo. |
@atherdon Okay so last night I learnt a lot about GraphQL, how it differs from the conventional RESTful APIs and some basic concepts of GraphQL. Basically it provides a |
I have added a file server.js and was able to run in on command line by doing |
please follow this link: https://github.com/GroceriStar/playing-with-graphql/invitations Please hold on with an actual coding part. I mean at first i want to understand that you know main features and basics. then we'll build some sort of we have at least few databases and i prepare some plan so we actually will not just replicate logic of our current API servers, but we also will extend and update it. |
@atherdon Thanks for providing me some perspective over the project, and yes I too realized that getting the basics of this is important. Specially for me because I have not worked much with APIs or back-end. |
i adore your pro-activity - don't want to loose it. But let's strict to main plan. this will be also more easy for me to follow your progress. So please check description of this task again - and try to explain to me for each sections at graph-ql intro what do you learn. this will raise a discussion between you and me, and we'll be able to start actual work at graphQl schema. when it'll looks cool - we'll start to test it. Because actually - we have everything for it. We have a mongodb, we have imported data to it. so only schemas holding us back. Btw, can you move that links to readme(please separate them from trash links that i store there), so other developers will have access to them too |
"searchDS": { "recipeDS": { This is links to our mongo databases - please move them to readme too |
This chapter talks about how GraphQL service is created. Basically we first define types and then fields on those types. Also the datatype on each field is specified here. We also provide functions for each field on each type so that we can retrieve that data(, or do something with it). It also describes how to send a query to receive data, which is very simple and flexible way to do so. |
which chapter? |
please follow this template: Chapter 1: Intro (https://graphql.org/learn/)"This chapter talks about how GraphQL service is created. Basically we first define types and then fields on those types. Also the datatype on each field is specified here. We also provide functions for each field on each type so that we can retrieve that data(, or do something with it). It also describes how to send a query to receive data, which is very simple and flexible way to do so." |
Chapter 2: Queries and Mutation (https://graphql.org/learn/queries/)
|
@sanchit94 perfect! |
please move this links to readme too: I think you saw this schemes, but i'll put it here, please move them to our readme too https://github.com/ChickenKyiv/database-visuals https://github.com/ChickenKyiv/database-visuals/tree/master/groceristar/models |
Done! 👍 |
Chapter 3: Schemas and Types (https://graphql.org/learn/schema/)
|
Chapter 4: Validation(https://graphql.org/learn/validation/)Validation is done using type system to determine whether a query is valid or not. So there are some rules that we need to follow.
This valid query, but if we try to implement the same using a fragment like
then it is invalid, as a fragment is calling itself.
|
Chapter 5: Execution (https://graphql.org/learn/execution/)GraphQL query is executed after Validation which resolves to a JSON response, generally. Root fields and resolver: Root type is the top level of the query. In the example given in the documentation, the root query has a resolver function human, which takes four arguments:
Asynchronous Resolvers: The query does not always return data, but it returns a Trivial Resolvers: Trivial resolver is one that simply fetched the value of the field. Some libraries let us omit these trivial resolvers and do this for us by default. Scalar Coercion: GraphQL can use List Resolvers: When a field type is a list, then GraphQL will return a list of Producing the result: As the fields are resolved, the result is displayed in form of key-value pair(JSON) which looks like the query we requested. |
btw, we're continue our work on grapqhql server, maybe this will be also interesting for you as backend development. repo: https://github.com/GroceriStar/graphql-server |
Please start by reading the documentation, related to GraphQL: https://www.howtographql.com/
After reading each chapter - please briefly explain to me here what did you learn from it.
Format(example):
Chapter 1: Intro (https://graphql.org/learn/)
"It's covering the basics of graphql"
Questions: "How i can run it at my local PC"?
@sanchit94 - it's your task
The text was updated successfully, but these errors were encountered: