Yii Framework Forum

GraphQL support planned?

(Schanz15) #1

At my workplace we currently developing a project where we use GraphQL as opposed to traditional REST queries (the backend is not powered by Yii) for queries and mutations. I found this a very helpful technology which also speeds up the overall development process and was woundering if this is something that is considered to be supported natively in Yii 3.0.


are you talking about the server or the client implementation?

(Schanz15) #3

Server side


We will have REST API in Yii 3.0, but I don’t think Yii core team has the resources to provide GraphQL implementation. At least not in the initial release. If you have ideas on how this could be implemented feel free to propose these anyway. If we can provide a small set of tools that makes working with GraphQL easier I am for adding these.

(Schmunk) #5

I was thinking about a way to use GraphQL (by default) in SearchModels.

A PHP implementation from Crisu is here https://github.com/digiaonline/graphql-php

(Schanz15) #6

I am also working on a GraphQL module. Unfortunately I have almost no time for this. But whats already working is the GraphiQL in-browser IDE and /graphql endpoint. The idea is that the module can be configured with a list of model class names (similar to the \yii\rest\ActiveController) and automatically provide a number of GraphQL operations for CRUD.

// Edit: I am working with https://github.com/webonyx/graphql-php for server side GraphQL support. Anything special about the implementation that you linked to @schmunk?

// Edit 2: And I am refering to Yii2

(Schmunk) #7

Anything special about the implementation that you linked to @schmunk?

It’s written by https://github.com/crisu83 a former Yii contributor and usually known for excellent code.