@ -28,49 +28,6 @@ It can be at the same time painful, because it requires individual creation of e
The main feature of graphql compared to REST is that it lets you ask for specific information. And even better then that is the nesting feature.
Lets take for instance the social network project, if the server had a Graphql API that was connected to the database we could query this API using graphql language:
```js
query {
user {
name
}
}
```
This simple query will return an array with the name of the users. Imagine if you wanted the `date_of_birth`,\
you could just add this attribute to the query, example:
```js
query {
user {
name
dateOfBirth
}
}
```
Example for the nesting fetching:
```js
query {
user(id: "13") {
name
dateOfBirth
followers {
id
name
}
}
}
```
For this example we ask for the user followers attribute, requesting the followers names and ids.\
The examples above are simple examples. **Note** that for this query is required the introduction of variables (arguments)\
so it will return just one user, the user that as the id equal to `13`.
In graphql the usage of arguments can be specified in the schema of the API endpoint. Here is the _docs_ for the graphql endpoint you are going to use, _https://[[DOMAIN]]/public/subjects/grapqhl_
---
### **profile**
@ -80,7 +37,7 @@ You will have to create a profile system where you can see all the info of a stu
The display of the information is up to you to design, but it must include:
- Basic user identification, for example **githubLogin**
- **Basic user identification**, for example **githubLogin**
- **XP** amount
- **level**
- **grades**
@ -96,13 +53,13 @@ Beside this information, you will have to create a search engine which returns a
- level
- skills
For instance you can search for a student by their `githubLogin` or filter the students by the amount of `XP` or which `level`/`skill`.
For instance you can search for a student by their `githubLogin` or filter the students by the amount of `XP` or which `level`/`skill` they have.
---
### Usage
> Here is the list of tables that you are allowed to query, for more information you can check out the _docs_`https://[[DOMAIN]]/public/subjects/grapqhl`:
> Here is the list of tables that you are allowed to query, for more information about the graphql endpoint you are going to use, check out the _docs__https://[[DOMAIN]]/public/subjects/grapqhl_:
- **User table**:
@ -124,7 +81,7 @@ For instance you can search for a student by their `githubLogin` or filter the s
In graphql the usage of arguments can be specified in the schema of the API endpoint. Here is the _docs_ for the graphql endpoint you are going to use, _https://[[DOMAIN]]/public/subjects/grapqhl_
nesting fetching, using the :
```js
{
result {
id
user {
id
githubLogin
}
}
}
```
For this example we ask for the results `id` and `user`s that are associated to the `result`, requesting the users `name`s and `id`s.\