File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ resolver's purpose.
8686- You ** MUST NOT** create subdirectories/namespace to group mutations or queries.
8787- You ** MUST** keep the modules under a flat structure.
8888- You ** MUST** use the ` Batch ` prefix for batch mutations.
89+ - You ** MUST NOT** use the ` Of[Parent Object Name] ` suffix when the field is
90+ defined within an object that is intended to be flattened via ` import_fields ` .
91+ The field name alone ** MUST** be used as the module name since these fields
92+ are imported into the parent schema and lose their original object context.
8993
9094### Example
9195
@@ -121,10 +125,20 @@ defmodule Umbrella.Web.Graphql.Schema do
121125 end
122126 end
123127
128+ # Object intended for import_fields - no "Of" suffix needed
129+ object :banking_queries do
130+ field :pending_transfers , list_of (:transfer ) do
131+ resolve & Query .PendingTransfers .resolve / 3
132+ end
133+ end
134+
124135 query do
125136 field :deposit_account , non_null (:deposit_account ) do
126137 resolve & Query .DepositAccount .resolve / 3
127138 end
139+
140+ # Fields imported from banking_queries object
141+ import_fields (:banking_queries )
128142 end
129143
130144 mutation do
You can’t perform that action at this time.
0 commit comments