GraphQL
GraphQL offers an alternative approach to REST APIs, transforming your application into a dynamic graph database that enables precise data retrieval.
This approach thrives on the advantages of the asynchronous PHP, as it seamlessly retrieves data from multiple sources (such as databases or APIs) concurrently.
Under the Hood
Internally, this framework uses webonyx/graphql-php library to implement its GraphQL capabilities.
Resonance utilizes Swoole Futures to bridge the framework, the external GraphQL library, and Swoole and to enable asynchronous resolution of GraphQL fields.
Developing Schema
Develop GraphQL schemas using Resonance by using the code-first approach.
Reusing Database Queries
Optimize GraphQL responses by reusing SQL queries, preventing redundant database queries for requested data.
Standalone Promise Adapter
Use Resonance's Swoole Promise adapter as a standalone component.