GraphQL PHP Server

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 เม.ย. 2018
  • Explanation of GraphQL PHP Server.
    Code: github.com/benawad/php-graphq...
    ----
    Video Suggestions:
    Trello: trello.com/b/mErpLVj7/todo
    Join the Trello board: trello.com/invite/b/mErpLVj7/...
    ----
    Follow Me Online Here:
    GitHub: github.com/benawad
    LinkedIn: / benawad
    Instagram: / benawad97
    Patreon: / benawad
    ----
    Join the Discord: / discord
    Twitter: / benawad
    #benawad
    TikTok: / benawad ​

    ----
    Follow me online: voidpet.com/benawad
    #benawad
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @RenatoMF000
    @RenatoMF000 5 ปีที่แล้ว +2

    Well done, specially with someone who isn't a php coder and being able to figure it all out.
    I've seen you used some overblog components, you can now make use of symfony 4 and overblog graphql bundle, this will give you an easier setup and also full featured. There are plenty of tutorials on it to start with!

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

    What a nice tutorial!

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

    why source doesn't have vendor file ?

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

    Excellent tutorial. Could you please share how to create custom datatypes here.

  • @rajeebsahoo8636
    @rajeebsahoo8636 5 ปีที่แล้ว +4

    why would use graphql then if have to write sql queries on our own?

    • @bawad
      @bawad  5 ปีที่แล้ว

      You can use an orm with GraphQL

  • @sapfirko1
    @sapfirko1 ปีที่แล้ว

    really it was difficult to attach sql?

  • @muditmohantyagi
    @muditmohantyagi ปีที่แล้ว

    You have not told about how to run it

  • @MrLinuxFreak
    @MrLinuxFreak 5 ปีที่แล้ว

    looks too long and complex compare to quering with pdo in php.. does it have any advantages over pdo btw?

    • @bawad
      @bawad  5 ปีที่แล้ว

      never heard of pdo, so not sure

    • @RonChaplin702
      @RonChaplin702 5 ปีที่แล้ว

      @@bawad PDO can live right inside of GraphQL.

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

      @@ossip.1552 This explanation was extremely helpful. Thank you!

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

      @@ossip.1552 Very good explanation!

  • @alanlal5625
    @alanlal5625 6 ปีที่แล้ว

    it would be good if you could amp up the volume..

    • @bawad
      @bawad  6 ปีที่แล้ว

      My mic is quiet, this is the amped up version :(

    • @alanlal5625
      @alanlal5625 6 ปีที่แล้ว

      ☹️☹️ it's alright then..I'll use headphones

  • @jennyjoseph7119
    @jennyjoseph7119 5 ปีที่แล้ว

    I am new in graphQL. I need to get data from a server which is using graphQL and I need to use PHP curl for passing the inputs.
    Is this a right query to pass to curl for getting data?
    $query =

    • @bawad
      @bawad  5 ปีที่แล้ว

      I would try typing out the query using graphql playground github.com/prisma/graphql-playground
      It will autocomplete and tell you if there's a syntax error in your query. Then it lets you convert that query into a curl request which should be pretty easy to convert to PHP curl

    • @jennyjoseph7119
      @jennyjoseph7119 5 ปีที่แล้ว

      Thank you for your reply. I have tried the same, when I have copied the curl I got the data which I need to pass as post is as follows
      --data-binary '{"query":"query categories {
      testCategories(conumber: : \"099942\") {
      various {
      id,
      name
      },
      permanent {
      id,
      name
      }
      }
      }"}' --compressed
      this query I have converted into PHP as above showned and encode with json:
      $json = json_encode(["query" => $query ]);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $json );
      But still getting the error.Is this any query format issue?

    • @bawad
      @bawad  5 ปีที่แล้ว

      Does it work if you run the curl command?

    • @jennyjoseph7119
      @jennyjoseph7119 5 ปีที่แล้ว

      Yes, Its working with curl

    • @bawad
      @bawad  5 ปีที่แล้ว

      Then there must be some error when converting it to php curl. I'm not familiar with how phps curl works so I'm not sure

  • @jasonshen
    @jasonshen 6 ปีที่แล้ว

    looks pretty complicated compare with nodejs

    • @bawad
      @bawad  6 ปีที่แล้ว

      Yeah

    • @binary64
      @binary64 6 ปีที่แล้ว

      Yea! Just that PHP is a more common backend, in certain areas.

  • @sridhar.ssampath7850
    @sridhar.ssampath7850 6 ปีที่แล้ว

    Hi Ben, this tutorial is really good. I want to get pet list from the people.Example people{ name pet[{pet1},{pet2}]} Do you have any other link for this tutorial?

    • @bawad
      @bawad  6 ปีที่แล้ว

      Sorry, this is the only video I did on this

  • @Kovad6
    @Kovad6 5 ปีที่แล้ว +3

    SQL != sequel -.-

    • @bawad
      @bawad  5 ปีที่แล้ว

      😂

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

      @@bawad why do you use the laughing emote? You are an idiot for saying sequel! period!

  • @andresmontoya7852
    @andresmontoya7852 6 ปีที่แล้ว +2

    PHP is ugly xD I don't like it. Would be great if your create the same but with Django - Python :D, Graphql in production is more common in Django or NodeJS :D

    • @bawad
      @bawad  6 ปีที่แล้ว +1

      Yeah, I'm not a PHP fan. I want to try it with elixir and Django

    • @Rohitkumar-xv7uv
      @Rohitkumar-xv7uv 6 ปีที่แล้ว

      Dude GraphQL is created by facebook and at that time GraphQL was mainly built for scaling php web applications (most of the facebook's backend is in php) and python is specially suitable for data-science and data-mining or AI, Machine learning things. DJango is just a choice.

    • @andresmontoya7852
      @andresmontoya7852 6 ปีที่แล้ว

      Rohit kumar Facebook is a Frankenstein basically, it has a lot technologies, no only php, maybe 20% old code is made in php :)

    • @MrShojibur
      @MrShojibur 5 ปีที่แล้ว +1

      Seems like we are in beauty contest, Most importantly, PHP is practical. PHP isn't built to win any beauty contests, its built for practical web programming at which it is simply the best. No doubt, the award for being beautiful goes to its pretty sister Python (just like it went to C's pretty sister Pascal in the early years), but when it comes to who's good at web development, there is simply no contest, period!

    • @kshitijkumar326
      @kshitijkumar326 5 ปีที่แล้ว +2

      PHP is ugly and you're promoting JS and Django :O
      Get out of here you dumbfuck.