Skip to content

Commit 0691db6

Browse files
committed
docs(faq): add InputType and ArgsType question
1 parent 55c8056 commit 0691db6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/faq.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ It really depends on various factors:
1515
### Should I use array of manually imported resolver classes or use a glob path string?
1616
Using path to resolver module files force you to structure yours project folders or constantly name files with prefix/suffix.
1717
When you have several dozen of resolver classes, it might be easier than always remember about importing and registering each new class.
18+
19+
## Types
20+
21+
### Is `@InputType()` different from `@ArgsType()`?
22+
Of course!
23+
`@InputType` will generate real `GraphQLInputType` and should be used when you want to have nested object in args:
24+
```graphql
25+
updateItem(data: UpdateItemInput!): Item!
26+
```
27+
28+
`@ArgsType` is virtual and it will be flattened in schema:
29+
```graphql
30+
updateItem(id: Int!, userId: Int!): Item!
31+
```

0 commit comments

Comments
 (0)