Slide 1

Slide 1 text

Hi, I’m Sujith Kumar I work at AlphaWebLab

Slide 2

Slide 2 text

GraphQL GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data

Slide 3

Slide 3 text

What is GraphQL- ❏ Query Language ( GraphQL Schema Language ) ❏ Type System type User { id name email } type Query { user { id name email } } type Mutation { createUser(name:“x”, email:“y”) { id name email } }

Slide 4

Slide 4 text

❏ Declarative Data Fetching ❏ Self Documenting

Slide 5

Slide 5 text

GET /posts

Slide 6

Slide 6 text

{ allPosts { id title created_at user { id name } } } { "data": { "allPosts": [ { "id": "1", "title": "Assumenda …//.", "created_at": "2020-01//.", "user": { "id": "1", "name": "Veda Ruecker" } }, {//.}, ] } } Declarative Data Fetching

Slide 7

Slide 7 text

Hands-On

Slide 8

Slide 8 text

Steps - Laravel & GraphQL ● Installation & setup ● Defining Type for model ● Query type ● Relationships ● Pagination ● Mutations ● Authentication

Slide 9

Slide 9 text

Steps - Laravel & GraphQL ● laravel new projectName - Create new laravel project ● composer require nuwave/lighthouse - Install Lighthouse Package ● Publish default schema: - Run php artisan vendor:publish --provider="Nuwave\Lighthouse\LighthouseServiceProvider" --tag=schema ● Publish default config: ● - Run php artisan vendor:publish --provider="Nuwave\Lighthouse\LighthouseServiceProvider" --tag=config ● Install graphql-playground: - Run composer require mll-lab/laravel-graphql-playground

Slide 10

Slide 10 text

Parameters of a resolver fn

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Github [https://github.com/SujithJr/laravel-graphql] SpeakerDeck [https://speakerdeck.com/sujithjr/laravel-with-graphql]

Slide 13

Slide 13 text

Thank You @codenameJr iamsanju.jr