File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,44 @@ slug: /graphql
1010>
1111> -- <cite >[ graphql.org] ( https://graphql.org/ ) </cite >
1212
13+ ## API
14+
1315The Symfony Boilerplate uses [ GraphQLite] ( https://graphqlite.thecodingmachine.io/ ) to quickly build a GraphQL API based
1416on your models and use cases.
1517
1618As the documentation of this PHP library covers a lot of aspects, we invite you to read it to have a better understanding
1719of its functionalities.
1820
21+ ## Client
22+
23+ The Symfony Boilerplate uses [ graphql-request] ( https://github.com/prisma-labs/graphql-request ) client.
24+
25+ It is available in a Vue component thanks to ` this.$graphql ` .
26+
27+ Queries and mutations are JavaScript files. For instance:
28+
29+ ``` js title="src/webapp/graphql/auth/me.query.js"
30+ import { gql } from ' graphql-request'
31+ import { MeFragment } from ' @/graphql/auth/me.fragment'
32+
33+ export const MeQuery = gql `
34+ query me {
35+ me {
36+ ... on User {
37+ ... MeFragment
38+ }
39+ }
40+ }
41+ ${ MeFragment}
42+ `
43+ ```
44+
45+ ::: note
46+
47+ 📣  ;  ; A fragment is useful is you want to fetch the same data in many queries and mutations.
48+
49+ :::
50+
1951## Tools
2052
2153The API provides the endpoint ` /graphiql ` (in development) so that you may quickly test a query or a mutation.
You can’t perform that action at this time.
0 commit comments