@@ -77,7 +77,7 @@ buildGQLContext =
77
77
78
78
allActionInfos = Map. elems allActions
79
79
queryRemotesMap =
80
- fmap (map fDefinition . ( \ (x,_,_) -> x) . rscParsed . fst ) allRemoteSchemas
80
+ fmap (map fDefinition . piQuery . rscParsed . fst ) allRemoteSchemas
81
81
buildFullestDBSchema
82
82
:: m ( Parser 'Output (P. ParseT Identity ) (OMap. InsOrdHashMap G. Name (QueryRootField UnpreparedValue ))
83
83
, Maybe (Parser 'Output (P. ParseT Identity ) (OMap. InsOrdHashMap G. Name (MutationRootField UnpreparedValue )))
@@ -119,15 +119,14 @@ buildGQLContext =
119
119
-- This block of code checks that there are no conflicting root field names between remotes.
120
120
remotes ::
121
121
[ ( RemoteSchemaName
122
- , ( [P. FieldParser (P. ParseT Identity ) (RemoteSchemaInfo , G. Field G. NoFragments P. Variable )]
123
- , Maybe [P. FieldParser (P. ParseT Identity ) (RemoteSchemaInfo , G. Field G. NoFragments P. Variable )]
124
- , Maybe [P. FieldParser (P. ParseT Identity ) (RemoteSchemaInfo , G. Field G. NoFragments P. Variable )]
125
- )
122
+ , ParsedIntrospection
126
123
)
127
124
] <- (| foldlA' (\ okSchemas (newSchemaName, (newSchemaContext, newMetadataObject)) -> do
128
125
checkedDuplicates <- (| withRecordInconsistency (do
129
- let (queryOld, mutationOld, _subscriptionOld) = unzip3 $ fmap snd okSchemas
130
- let (queryNew, mutationNew, _subscriptionNew) = rscParsed newSchemaContext
126
+ let (queryOld, mutationOld) =
127
+ unzip $ fmap ((\ case ParsedIntrospection q m _ -> (q,m)) . snd ) okSchemas
128
+ let ParsedIntrospection queryNew mutationNew _subscriptionNew
129
+ = rscParsed newSchemaContext
131
130
-- Check for conflicts between remotes
132
131
bindErrorA -<
133
132
checkFieldNamesUnique (fmap (P. getName . fDefinition) (queryNew ++ concat queryOld))
@@ -165,8 +164,8 @@ buildGQLContext =
165
164
-- | The 'query' type of the remotes. TODO: also expose mutation
166
165
-- remotes. NOT TODO: subscriptions, as we do not yet aim to support
167
166
-- these.
168
- queryRemotes = concatMap (( \ (q,_,_) -> q) . snd ) remotes
169
- mutationRemotes = concatMap (concat . ( \ (_,m,_) -> m) . snd ) remotes
167
+ queryRemotes = concatMap (piQuery . snd ) remotes
168
+ mutationRemotes = concatMap (concat . piMutation . snd ) remotes
170
169
queryHasuraOrRelay = case queryType of
171
170
QueryHasura -> queryWithIntrospection (Set. fromMap $ validTables $> () )
172
171
validFunctions queryRemotes mutationRemotes
0 commit comments