Usage
phonyql
provides queries and mutations, generated from provided data.
Queries
get by ID
query
query ($id: ID!) {User(id: $id) {name}}
variables
{"id": 123}
result
{"data": {"User": {"name": "John Doe"}}}
get all
- all users
- page 1 with 5 users per page
- sorted by their name in ascending order
- older than 25
query
query ($pagination: Pagination, $sorting: Sorting, $filter: UsersFilter) {allUsers(pagination: $pagination, sorting: $sorting, filter: $filter) {nameagecompany}}
variables
{"pagination": {"page": 0,"pageSize": 5},"sorting": {"field": "name","order": "asc"},"filter": {"fields": {"age_gt": 25}}}
result
{"data": {"allUsers": [{"name": "Abagail Kilback","age": 68,"company": "Gaylord - Block"},{"name": "Abigayle D'Amore","age": 27,"company": "Corwin, Ratke and Conroy"},{"name": "Adah Bernhard","age": 56,"company": "Murphy, Murazik and Lubowitz"},{"name": "Adonis Bechtelar","age": 43,"company": "Lakin - Senger"},{"name": "Adrain Hammes","age": 65,"company": "Ratke, Lind and McClure"}]}}
get meta data
query
{_allUsersMeta {count}}
result
{"data": {"_allUsersMeta": {"count": 202}}}