You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/graphql/README.md
+9-7
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,14 @@
4
4
5
5
This plugin has an opinion of how the GraphQL API schema should look like:
6
6
7
-
- Query for multiple records is plural camelCase: `blogPosts`.
8
-
- Mutations begin with the verb (`create`, `update`, `delete`) and the camelCased entity: `createBlogPost` for example.
9
-
- The create mutation expects the new record as a input type argument.
10
-
- The update mutation expects two arguments: The ID and the new record as a input type.
11
-
- The delete mutation expects the record ID to delete.
7
+
- Query name for single record is singular camelCase: `blogPost`.
8
+
- Query name for multiple records is plural camelCase: `blogPosts`.
12
9
- Multiple records are within a `nodes` object and filtered by a `filter` argument.
10
+
- Mutations begin with the verb (`create`, `update`, `delete`) and the camelCased entity: `createBlogPost` for example.
11
+
- The create mutation (generated by `$persist`) expects the new record as a input type argument (`createBlogPost(blogPost: BlogPostInput!)`).
12
+
- The update mutation (generated by `$push`) expects two arguments: The ID and the new record as a input type (`updateBlogPost(id: ID!, blogPost: BlogPostInput!)`).
13
+
- The delete mutation (generated by `$destroy`) expects the record ID to delete (`deleteBlogPost(id: ID!)`).
13
14
14
-
You will find concrete examples of the GraphQL queries which are generated by this plugin in the
15
-
respective chapters of this documentation.
15
+
You will find concrete examples of the GraphQL queries which are generated by this plugin in the respective chapters of
16
+
this documentation. Also we recommend to activate the debug mode of the plugin, which will show you the queries which
After that we setup the plugin. Add this after registering your models to the database:
21
+
After that we setup the plugin. Add this after [registering your models to the database](https://vuex-orm.github.io/vuex-orm/prologue/getting-started.html#register-models-and-modules-to-the-vuex-store):
0 commit comments