Skip to content

Commit abdc734

Browse files
committed
Docs
1 parent e63a00f commit abdc734

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

docs/guide/faq/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
[[toc]]
44

5+
## WTF?
6+
7+
Good question, glad you asked! Maybe [this article](https://dev.to/phortx/vue-3-graphql-kj6) helps you. If not, feel
8+
free to join us on our [Slack Channel](https://join.slack.com/t/vuex-orm/shared_invite/enQtMzY5MzczMzI2OTgyLTAwOWEwOGRjOTFmMzZlYzdmZTJhZGU2NGFiY2U2NzBjOWE4Y2FiMWJkMjYxMTAzZDk0ZjAxNTgzZjZhY2VkZDQ)
9+
for any questions and discussions.
10+
11+
12+
## Does Vuex-ORM-GraphQL know my GraphQL Schema?
13+
14+
Yes, it does! Before the first query is sent, the plugin loads the schema from the GraphQL server and extracts different
15+
information like the types of the fields to use, which fields to ignore, because they're not in the schema and whether
16+
custom queries and mutations return a connection or a record.
17+
18+
Further it detects differences between the Vuex-ORM model definitions and the schema.
19+
20+
In the future there will probably be more smart consulting of your GraphQL schema, we're open for suggestions.
21+
522

623
## Is this plugin nativescript-vue compatible?
724

docs/guide/virtual-fields/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
It may happen that you want fields in your Vuex-ORM model, which are not in the respective GraphQL Type.
66
We call these "virtual fields" because they are only known to the Vuex-ORM and not to your backend or database.
77

8-
This plugin will automatically query all fields of the model, but when your GraphQL API doesn't know a field, it returns
9-
an error. So we have to prevent the querying of our virtual fields. For that we have the `skipFields` field in our model:
8+
This plugin will automatically detect which fields are not included in the schema and will not query them at all.
109

10+
Let's assume we have a product model with the field `parsedMarkdownContent` which is not known to our GraphQL server:
1111

1212
```javascript{4}
1313
export default class Product extends Model {
1414
static entity = 'products';
1515
16-
static skipFields = ['parsedMarkdownContent'];
17-
1816
static fields () {
1917
return {
2018
id: this.increment(),
@@ -40,4 +38,4 @@ query Posts() {
4038
}
4139
```
4240

43-
As you see the `parsedMarkdownContent` field is not queried.
41+
As you see the `parsedMarkdownContent` field is not queried due to the fact that it's not in the GraphQL Schema.

0 commit comments

Comments
 (0)