I agree with your opinion, you make very good points! While its very powerful, it takes time to learn, just like with SQL. I think coming in as a new user or novice, you should not get into GraphQL first, but rather REST. I have found that REST is the easiest to learn and understand. With some experience, users can approach GraphQL more easily.
You're welcome, thank you for watching! 😊I would say thats not normally the case that a public API allows your to modify data without auth. It seems to only allow data modification for users, which I guess thats not too bad since thats dummy data. Now if you could modify the SpaceX data he's collected, then yea, that would be a problem!
Hi @Aliaksandr Maksimchuk, Thanks for watching 😊, and you're welcome! Thats a great question, I'll refer you to the following URL as the source of my explanation / understanding: graphql.org/graphql-js/mutations-and-input-types/ So you can define the Mutation within the "root resolver" (which seems to be in the code) or within the GraphQL Schema. It looks to be best practice to define your Mutations within the GraphQL Schema, as noticed in the example in the link above. Here, you can use the same input object for a number of different mutations. So in this example, you can find the Query type in the GraphQL Schema (link to the SpaceX.land Schema in the description), but I cant seem to find the Mutation (Spacex.land graphql schema link in description). I found references Mutation under src -> schema -> types -> type.d.ts file, but not as in depth as you see with the GraphiQL browser client (link in the description). So the deployed version may be different than the version we see in the schema, but nonetheless, we should find the methods at the root resolver or schema. Lastly, I believe its standard that the HTTP method is always a POST (much unlike REST), since the actual request body is whats communicating to the backend via its query language, but not sure if that's consistent. I hope this answers your question!
Hi @Heitor Rosani, thanks for watching! The link to the schema is in the description, you can find it here: codesandbox.io/s/github/spacexland/api/tree/master/?file=/schema.graphql
@Slava Sosnin thanks for watching! While I can't find a "Save To File" option, if you just copy the schema code from the link, and paste into a text editor and save it as schema.graphql, you can get it into a file that way. If this isn't what you are referring to, let me know.
@@DevOdyssey I wanted to do it this way just wandered if it's possible to save to file. Thanks for the great video and for the answer. Have a great day!
@Slava Sosnin I gotcha, that would be convenient. You can actually probably use Postman so send a request to the url (codesandbox.io/s/github/spacexland/api/tree/master/?file=/schema.graphql), and the do a "send and save" and save it to file that way, but not directly from the website from what I see. You're welcome. Thank you for the compliment 😊 Have a great day as well!
2 ปีที่แล้ว
How can I get the schema from an API I have access?
Thanks for watching Eros! In regards to getting the schema for an API you have access to, you'd more likely than not have to reach out to the third party that gives you access and ask for the schema. There is probably some documentation or location where they expose they expose the schema. Unless there is an endpoint within the GraphQL where its available, you'll generally have to be told where to find it from the entity that manages the API.
2 ปีที่แล้ว +1
@@DevOdyssey Thank you for you response, and for the great and simple video to start API testing GQL. Regards!
What do you think of GraphQL? Do you see yourself using it over REST?
GraphQL is powerful, but currently, I feel it is too hard for new users to build queries.
I agree with your opinion, you make very good points! While its very powerful, it takes time to learn, just like with SQL. I think coming in as a new user or novice, you should not get into GraphQL first, but rather REST. I have found that REST is the easiest to learn and understand. With some experience, users can approach GraphQL more easily.
Thanks for the tutorial, Orest. Interesting API that lets you add and delete data without any auth 🤔
You're welcome, thank you for watching! 😊I would say thats not normally the case that a public API allows your to modify data without auth. It seems to only allow data modification for users, which I guess thats not too bad since thats dummy data. Now if you could modify the SpaceX data he's collected, then yea, that would be a problem!
Thanks For video, but could you explain, how do you know syntax of inserting or deletion? Is it the same for every GraphQl Schema? Thx
Hi @Aliaksandr Maksimchuk,
Thanks for watching 😊, and you're welcome!
Thats a great question, I'll refer you to the following URL as the source of my explanation / understanding:
graphql.org/graphql-js/mutations-and-input-types/
So you can define the Mutation within the "root resolver" (which seems to be in the code) or within the GraphQL Schema. It looks to be best practice to define your Mutations within the GraphQL Schema, as noticed in the example in the link above. Here, you can use the same input object for a number of different mutations.
So in this example, you can find the Query type in the GraphQL Schema (link to the SpaceX.land Schema in the description), but I cant seem to find the Mutation (Spacex.land graphql schema link in description).
I found references Mutation under src -> schema -> types -> type.d.ts file, but not as in depth as you see with the GraphiQL browser client (link in the description). So the deployed version may be different than the version we see in the schema, but nonetheless, we should find the methods at the root resolver or schema.
Lastly, I believe its standard that the HTTP method is always a POST (much unlike REST), since the actual request body is whats communicating to the backend via its query language, but not sure if that's consistent.
I hope this answers your question!
@@DevOdyssey Great Answer, Thanks a lot and have a good day:)
Thanks @Aliaksandr Maksimchuk, have a great day as well! 😊
Nice video, but, where I find the schema?
Hi @Heitor Rosani, thanks for watching!
The link to the schema is in the description, you can find it here:
codesandbox.io/s/github/spacexland/api/tree/master/?file=/schema.graphql
Have you figured out how to save it as a file to your computer mate? Because I haven't ((
@Slava Sosnin thanks for watching!
While I can't find a "Save To File" option, if you just copy the schema code from the link, and paste into a text editor and save it as schema.graphql, you can get it into a file that way.
If this isn't what you are referring to, let me know.
@@DevOdyssey I wanted to do it this way just wandered if it's possible to save to file. Thanks for the great video and for the answer. Have a great day!
@Slava Sosnin I gotcha, that would be convenient. You can actually probably use Postman so send a request to the url (codesandbox.io/s/github/spacexland/api/tree/master/?file=/schema.graphql), and the do a "send and save" and save it to file that way, but not directly from the website from what I see.
You're welcome. Thank you for the compliment 😊 Have a great day as well!
How can I get the schema from an API I have access?
Thanks for watching Eros!
In regards to getting the schema for an API you have access to, you'd more likely than not have to reach out to the third party that gives you access and ask for the schema. There is probably some documentation or location where they expose they expose the schema. Unless there is an endpoint within the GraphQL where its available, you'll generally have to be told where to find it from the entity that manages the API.
@@DevOdyssey Thank you for you response, and for the great and simple video to start API testing GQL. Regards!
@ you’re welcome! Glad you found it useful. Have fun testing GraphQL APIs!