@@ -39,43 +39,31 @@ To distinguish queries from mutations and fragments, the following naming conven
...
@@ -39,43 +39,31 @@ To distinguish queries from mutations and fragments, the following naming conven
-`addUser.mutation.graphql` for mutations;
-`addUser.mutation.graphql` for mutations;
-`basicUser.fragment.graphql` for fragments.
-`basicUser.fragment.graphql` for fragments.
GraphQL:
- Queries are stored in `(ee/)app/assets/javascripts/` under the feature. For example, `respository/queries`. Frontend components can use these stored queries.
- Mutations are stored in
`(ee/)app/assets/javascripts/<subfolders>/<name of mutation>.mutation.graphql`.
### Fragments
### Fragments
Fragments are a way to make your complex GraphQL queries more readable and re-usable.
Fragments are a way to make your complex GraphQL queries more readable and re-usable. Here is an example of GraphQL fragment:
They can be stored in a separate file and imported.
For example, a fragment that references another fragment:
```javascript
fragmentDesignListItemonDesign{
```ruby
fragmentBaseEpiconEpic{
id
id
iid
image
title
event
webPath
filename
relativePosition
notesCount
userPermissions{
adminEpic
createEpic
}
}
}
```
fragmentEpicNodeonEpic{
Fragments can be stored in separate files, imported and used in queries, mutations or other fragments.