Learning GraphQL With Postman

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 19

  • @DevOdyssey
    @DevOdyssey  4 ปีที่แล้ว

    What do you think of GraphQL? Do you see yourself using it over REST?

    • @vdespa
      @vdespa 4 ปีที่แล้ว +1

      GraphQL is powerful, but currently, I feel it is too hard for new users to build queries.

    • @DevOdyssey
      @DevOdyssey  4 ปีที่แล้ว

      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.

  • @vdespa
    @vdespa 4 ปีที่แล้ว +2

    Thanks for the tutorial, Orest. Interesting API that lets you add and delete data without any auth 🤔

    • @DevOdyssey
      @DevOdyssey  4 ปีที่แล้ว

      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!

  • @koolvent
    @koolvent 3 ปีที่แล้ว +1

    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

    • @DevOdyssey
      @DevOdyssey  3 ปีที่แล้ว +1

      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!

    • @koolvent
      @koolvent 3 ปีที่แล้ว

      @@DevOdyssey Great Answer, Thanks a lot and have a good day:)

    • @DevOdyssey
      @DevOdyssey  3 ปีที่แล้ว

      Thanks @Aliaksandr Maksimchuk, have a great day as well! 😊

  • @mynameisheitor
    @mynameisheitor 3 ปีที่แล้ว +2

    Nice video, but, where I find the schema?

    • @DevOdyssey
      @DevOdyssey  3 ปีที่แล้ว

      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

    • @slavamay6229
      @slavamay6229 3 ปีที่แล้ว +1

      Have you figured out how to save it as a file to your computer mate? Because I haven't ((

    • @DevOdyssey
      @DevOdyssey  3 ปีที่แล้ว +1

      @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.

    • @slavamay6229
      @slavamay6229 3 ปีที่แล้ว +1

      @@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!

    • @DevOdyssey
      @DevOdyssey  3 ปีที่แล้ว +1

      @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?

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว +1

      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!

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      @ you’re welcome! Glad you found it useful. Have fun testing GraphQL APIs!