Safe Haskell | None |
---|---|
Language | Haskell2010 |
Tools for generating fields for Apollo federation
Synopsis
- data ApolloFederationParserFunction n = ApolloFederationParserFunction {}
- data ApolloFederationAnyType = ApolloFederationAnyType {
- afTypename :: Name
- afPKValues :: Object
- anyParser :: Parser origin 'Both Parse ApolloFederationAnyType
- convertToApolloFedParserFunc :: (Monad n, MonadParse n, Backend b) => SourceInfo b -> TableInfo b -> TablePermG b (UnpreparedValue b) -> StringifyNumbers -> Maybe NamingCase -> NESeq (ColumnInfo b) -> Parser 'Output n (AnnotatedFields b) -> Parser 'Output n (ApolloFederationParserFunction n)
- modifyApolloFedParserFunc :: (MonadParse n, Backend b) => SourceInfo b -> TableInfo b -> TablePermG b (UnpreparedValue b) -> StringifyNumbers -> Maybe NamingCase -> NESeq (ColumnInfo b) -> AnnotatedFields b -> ApolloFederationParserFunction n
- mkServiceField :: FieldParser Parse (SchemaIntrospection -> QueryRootField UnpreparedValue)
- apolloRootFields :: HashSet ExperimentalFeature -> [(Name, Parser 'Output Parse (ApolloFederationParserFunction Parse))] -> [FieldParser Parse (SchemaIntrospection -> QueryRootField UnpreparedValue)]
- generateSDL :: SchemaIntrospection -> Text
- filterAndWrapTypeSystemDefinition :: TypeDefinition [Name] InputValueDefinition -> Maybe TypeSystemDefinition
- mkEntityUnionFieldParser :: [(Name, Parser 'Output Parse (ApolloFederationParserFunction Parse))] -> FieldParser Parse (QueryRootField UnpreparedValue)
- concatQueryRootFields :: [QueryRootField UnpreparedValue] -> QueryRootField UnpreparedValue
Documentation
data ApolloFederationParserFunction n Source #
Internal parser function for entities field
data ApolloFederationAnyType Source #
Haskell representation of _Any scalar
ApolloFederationAnyType | |
|
convertToApolloFedParserFunc :: (Monad n, MonadParse n, Backend b) => SourceInfo b -> TableInfo b -> TablePermG b (UnpreparedValue b) -> StringifyNumbers -> Maybe NamingCase -> NESeq (ColumnInfo b) -> Parser 'Output n (AnnotatedFields b) -> Parser 'Output n (ApolloFederationParserFunction n) Source #
modifyApolloFedParserFunc :: (MonadParse n, Backend b) => SourceInfo b -> TableInfo b -> TablePermG b (UnpreparedValue b) -> StringifyNumbers -> Maybe NamingCase -> NESeq (ColumnInfo b) -> AnnotatedFields b -> ApolloFederationParserFunction n Source #
mkServiceField :: FieldParser Parse (SchemaIntrospection -> QueryRootField UnpreparedValue) Source #
Creates _service
FieldParser
using the schema introspection.
This will allow us to process the following query:
query { _service { sdl } }
apolloRootFields :: HashSet ExperimentalFeature -> [(Name, Parser 'Output Parse (ApolloFederationParserFunction Parse))] -> [FieldParser Parse (SchemaIntrospection -> QueryRootField UnpreparedValue)] Source #
generateSDL :: SchemaIntrospection -> Text Source #
Generate sdl from the schema introspection
filterAndWrapTypeSystemDefinition :: TypeDefinition [Name] InputValueDefinition -> Maybe TypeSystemDefinition Source #
Filter out schema components from sdl which are not required by apollo federation and
wraps it in TypeSystemDefinition
mkEntityUnionFieldParser :: [(Name, Parser 'Output Parse (ApolloFederationParserFunction Parse))] -> FieldParser Parse (QueryRootField UnpreparedValue) Source #
Creates _entities
FieldParser
using Parser
s for Entity union, schema
introspection and a list of all query FieldParser
.
This will allow us to process the following query:
query ($representations: [_Any!]!) { _entities(representations: $representations) { ... on SomeType { foo bar } } }
concatQueryRootFields :: [QueryRootField UnpreparedValue] -> QueryRootField UnpreparedValue Source #
concatenates multiple fields