GithubHelp home page GithubHelp logo

daniyal-javani / laravel-graphql-example Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 2.31 MB

A sample and example of using GraphQL in Laravel

Home Page: https://github.com/rebing/graphql-laravel

PHP 96.85% HTML 3.15%
laravel graphql laravel-graphql

laravel-graphql-example's Introduction

What's it?

A simple example of Laravel GraphQL using https://github.com/rebing/graphql-laravel


How to use


Now check these out

View the documentation of your API

/graphql?query={__schema{types{name,fields{name,description}}}}

or

{
  __schema {
    types {
      name
      fields {
         name
         description
      }
    }
  }
}

Get all of the users

/graphql?query=query+FetchUsers{users{id,email}}

or

query FetchUsers {
    users {
        id
        email
    }
}

Get a specific user

/graphql?query=query+FetchUsers{users(id:"18"){id,email}}

or

query FetchUsers {
    users (id: "18"){
        id
        email
    }
}

update the password of a user

/graphql?query=mutation+users{updateUserPassword(id:%221%22,password:%22newpassword%22){id,email}}

or

mutation users {
    updateUserPassword(id: "1", password: "newpassword") {
        id
        email
    }
}

update the email of a user with validation

/graphql?query=mutation+users{updateUserEmail(id:%221%22,email:%22newemail%22){id,email}}

or

mutation users {
    updateUserEmail(id: "1", email: "[email protected]") {
        id
        email
    }
}

License

Please use and re-use however you want.

laravel-graphql-example's People

Contributors

daniyal-javani avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.