+1
Turning my Laravel app into a GraphQL endpoint
Hi Jeff,
it would be awesome if you can help us with a series on how to turn a Laravel app into a GraphQL endpoint. I am sure a lot of people out there are interested to find out. I hope the Laravel community will be among the front-runners to adopt and embrace this promising technology:)
I have tried...
https://github.com/Folkloreatelier/laravel-graphql
https://github.com/webonyx/graphql-php
... and got along quite well. I managed to handle "queries" via GraphQL w/ data populated via Eloquent calls. Yet I struggle to set up "mutations". I am also not sure how to set up GraphiQL, an in-browser IDE for writing, validating, and testing GraphQL queries.
The table of contents for a potential series could be:
- General overview of the concept
- Installing one of the aforementioned libraries
- Defining a type system or schema
- Setting up queries (FetchUsers)
- Setting up mutations (CreateUser, UpdateUser)
- Adding custom and built-in validation on mutations
- Using GraphiQL to validate whether your queries and mutations work
- Testing your queries, mutations, subscriptions using the dedicated graphql-php test framework (https://github.com/webonyx/graphql-php/blob/master/tests/StarWarsQueryTest.php)
- Implementation of the GraphQL Relay specifications (http://facebook.github.io/relay/docs/graphql-relay-specification.html)
Please or to participate in this conversation.