CMS-agnostic GraphQL server in PHP. Visit the site: graphql-by-pop.com
GraphQL by PoP is currently available for WordPress. Follow these instructions to install it.
Implementation of a GraphQL server, fully compliant of the spec. The core development is under the GraphQL server package.
Send a GraphQL query to your API and get exactly the data you need.
query PostsWithComments {
posts {
title
comments {
date
content
author {
name
}
}
}
}
The response from the API always mirrors the GraphQL query.
{
"data": {
"posts": [
{
"title": "Hello world!",
"comments": [
{
"date": "2020-04-08",
"content": "Check us out!",
"author": {
"name": "Leo"
}
}
]
}
]
}
}
- Fast: Queries are resolved in linear time on the number of types involved
- Simple: Resolvers deal with IDs (instead of objects), removing the need to implement batching/deferred
- Extensible: Types have their resolvers attached by injection, and resolvers can override each other
- Powerful: The engine is based on executing directives, allowing any type of custom functionality
The schema is generated from code. Work with your teammates concurrently on the schema without conflicts, without tooling, and without bureaucracy.
The resolvers attach themselves to the types. Each field can be handled by different resolvers, and the chosen one is selected on runtime, depending on the context.
From a single source of truth, expose different schemas for different users, managing it through Access Control Lists based on the user being logged-in or not, roles, capabilities, or custom rules.
In addition to evolving the GraphQL schema, every field and directive can be independently versioned, and the specific version to use is chosen through field/directive arguments in the query.
Cache the response from the query in several layers (server, CDN, etc) using standard HTTP caching, defining the max age field by field. Cache the results from expensive operations in disk or memory, defining the expiry time field by field.
Perform mutations on every type, not just on the root type, and have a mutation be executed on the result from another mutation. The schema gets neater and slimmer!
No need to worry if different teams or 3rd party providers using the same names for their types. Create neater schemas by removing the 'MyCompanyName' prefix from your types, you won't need it.
Issues with the query are shown in the response to the query, and not just when doing introspection. Avoid your users from never finding out that your schema has been upgraded!
Please check them on graphql-by-pop.com: