Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SchemaContext = SchemaContext {}
- data SchemaKind
- isHasuraSchema :: SchemaKind -> Bool
- type MonadBuildSchemaBase r m n = (MonadError QErr m, MonadReader r m, MonadMemoize m, MonadParse n, Has SchemaOptions r, Has SchemaContext r, Has MkTypename r, Has CustomizeRemoteFieldName r, Has NamingCase r)
- newtype RemoteRelationshipParserBuilder = RemoteRelationshipParserBuilder (forall lhsJoinField r n m. MonadBuildSchemaBase r m n => RemoteFieldInfo lhsJoinField -> m (Maybe [FieldParser n (RemoteRelationshipField UnpreparedValue)]))
- ignoreRemoteRelationship :: RemoteRelationshipParserBuilder
- newtype NodeInterfaceParserBuilder = NodeInterfaceParserBuilder {
- runNodeBuilder :: forall r n m. MonadBuildSchemaBase r m n => m (Parser 'Output n NodeMap)
- retrieve :: (MonadReader r m, Has a r) => (a -> b) -> m b
- type MonadBuildSourceSchema r m n = MonadBuildSchemaBase r m n
- runSourceSchema :: SchemaContext -> SchemaOptions -> ReaderT (SchemaContext, SchemaOptions, MkTypename, CustomizeRemoteFieldName, NamingCase) m a -> m a
- type MonadBuildRemoteSchema r m n = MonadBuildSchemaBase r m n
- runRemoteSchema :: SchemaContext -> SchemaOptions -> ReaderT (SchemaContext, SchemaOptions, MkTypename, CustomizeRemoteFieldName, NamingCase) m a -> m a
- type SelectExp b = AnnSimpleSelectG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type StreamSelectExp b = AnnSimpleStreamSelectG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type AggSelectExp b = AnnAggregateSelectG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type ConnectionSelectExp b = ConnectionSelect b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type SelectArgs b = SelectArgsG b (UnpreparedValue b)
- type SelectStreamArgs b = SelectStreamArgsG b (UnpreparedValue b)
- type TablePerms b = TablePermG b (UnpreparedValue b)
- type AnnotatedFields b = AnnFieldsG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type AnnotatedField b = AnnFieldG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type ConnectionFields b = ConnectionFields b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type EdgeFields b = EdgeFields b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)
- type AnnotatedActionFields = ActionFieldsG (RemoteRelationshipField UnpreparedValue)
- type AnnotatedActionField = ActionFieldG (RemoteRelationshipField UnpreparedValue)
- data RemoteSchemaParser n = RemoteSchemaParser {
- piQuery :: [FieldParser n (NamespacedField (RemoteSchemaRootField (RemoteRelationshipField UnpreparedValue) RemoteSchemaVariable))]
- piMutation :: Maybe [FieldParser n (NamespacedField (RemoteSchemaRootField (RemoteRelationshipField UnpreparedValue) RemoteSchemaVariable))]
- piSubscription :: Maybe [FieldParser n (NamespacedField (RemoteSchemaRootField (RemoteRelationshipField UnpreparedValue) RemoteSchemaVariable))]
- getTableRoles :: BackendSourceInfo -> [RoleName]
- askTableInfo :: forall b m. (Backend b, MonadError QErr m) => SourceInfo b -> TableName b -> m (TableInfo b)
- data Scenario
- textToName :: MonadError QErr m => Text -> m Name
- partialSQLExpToUnpreparedValue :: PartialSQLExp b -> UnpreparedValue b
- mapField :: Functor m => InputFieldsParser m (Maybe a) -> (a -> b) -> InputFieldsParser m (Maybe b)
- parsedSelectionsToFields :: (Text -> a) -> InsOrdHashMap Name (ParsedSelection a) -> Fields a
- numericAggOperators :: [Name]
- comparisonAggOperators :: [Name]
- mkDescriptionWith :: Maybe PGDescription -> Text -> Description
- takeValidTables :: forall b. Backend b => TableCache b -> TableCache b
- takeValidFunctions :: forall b. FunctionCache b -> FunctionCache b
- requiredFieldParser :: (Functor n, Functor m) => (a -> b) -> m (FieldParser n a) -> m (Maybe (FieldParser n b))
- optionalFieldParser :: (Functor n, Functor m) => (a -> b) -> m (Maybe (FieldParser n a)) -> m (Maybe (FieldParser n b))
- mkEnumTypeName :: forall b m r. (Backend b, MonadReader r m, Has MkTypename r, MonadError QErr m, Has NamingCase r) => EnumReference b -> m Name
- addEnumSuffix :: (MonadReader r m, Has MkTypename r) => GQLNameIdentifier -> Maybe Name -> NamingCase -> m Name
- peelWithOrigin :: MonadParse m => Parser 'Both m a -> Parser 'Both m (ValueWithOrigin a)
Documentation
data SchemaContext Source #
Aggregation of contextual information required to build the schema.
SchemaContext | |
|
data SchemaKind Source #
The kind of schema we're building, and its associated options.
isHasuraSchema :: SchemaKind -> Bool Source #
type MonadBuildSchemaBase r m n = (MonadError QErr m, MonadReader r m, MonadMemoize m, MonadParse n, Has SchemaOptions r, Has SchemaContext r, Has MkTypename r, Has CustomizeRemoteFieldName r, Has NamingCase r) Source #
The set of common constraints required to build the schema.
newtype RemoteRelationshipParserBuilder Source #
How a remote relationship field should be processed when building a schema. Injecting this function from the top level avoids having to know how to do top-level dispatch from deep within the schema code.
Note: the inner function type uses an existential qualifier: it is expected
that the given function will work for _any_ monad m
that has the relevant
constraints. This prevents us from passing a function that is specfic to the
monad in which the schema construction will run, but avoids having to
propagate type annotations to each call site.
RemoteRelationshipParserBuilder (forall lhsJoinField r n m. MonadBuildSchemaBase r m n => RemoteFieldInfo lhsJoinField -> m (Maybe [FieldParser n (RemoteRelationshipField UnpreparedValue)])) |
ignoreRemoteRelationship :: RemoteRelationshipParserBuilder Source #
A RemoteRelationshipParserBuilder
that ignores the field altogether, that can
be used in tests or to build a source or remote schema in isolation.
newtype NodeInterfaceParserBuilder Source #
How to build the Relay
node.
Similarly to what we do for remote relationships, we pass in the context the
builder function required to build the Node
interface, in order to avoid
the cross-sources cycles it creates otherwise.
NodeInterfaceParserBuilder | |
|
retrieve :: (MonadReader r m, Has a r) => (a -> b) -> m b Source #
type MonadBuildSourceSchema r m n = MonadBuildSchemaBase r m n Source #
runSourceSchema :: SchemaContext -> SchemaOptions -> ReaderT (SchemaContext, SchemaOptions, MkTypename, CustomizeRemoteFieldName, NamingCase) m a -> m a Source #
type MonadBuildRemoteSchema r m n = MonadBuildSchemaBase r m n Source #
runRemoteSchema :: SchemaContext -> SchemaOptions -> ReaderT (SchemaContext, SchemaOptions, MkTypename, CustomizeRemoteFieldName, NamingCase) m a -> m a Source #
type SelectExp b = AnnSimpleSelectG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type StreamSelectExp b = AnnSimpleStreamSelectG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type AggSelectExp b = AnnAggregateSelectG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type ConnectionSelectExp b = ConnectionSelect b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type SelectArgs b = SelectArgsG b (UnpreparedValue b) Source #
type SelectStreamArgs b = SelectStreamArgsG b (UnpreparedValue b) Source #
type TablePerms b = TablePermG b (UnpreparedValue b) Source #
type AnnotatedFields b = AnnFieldsG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type AnnotatedField b = AnnFieldG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type ConnectionFields b = ConnectionFields b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
type EdgeFields b = EdgeFields b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b) Source #
data RemoteSchemaParser n Source #
getTableRoles :: BackendSourceInfo -> [RoleName] Source #
askTableInfo :: forall b m. (Backend b, MonadError QErr m) => SourceInfo b -> TableName b -> m (TableInfo b) Source #
Looks up table information for the given table name. This function
should never fail, since the schema cache construction process is
supposed to ensure all dependencies are resolved.
TODO: deduplicate this with CacheRM
.
Whether the request is sent with `x-hasura-use-backend-only-permissions` set to true
.
Instances
Enum Scenario Source # | |
Defined in Hasura.GraphQL.Schema.Common | |
Eq Scenario Source # | |
Show Scenario Source # | |
textToName :: MonadError QErr m => Text -> m Name Source #
mapField :: Functor m => InputFieldsParser m (Maybe a) -> (a -> b) -> InputFieldsParser m (Maybe b) Source #
parsedSelectionsToFields Source #
:: (Text -> a) | how to handle |
-> InsOrdHashMap Name (ParsedSelection a) | |
-> Fields a |
numericAggOperators :: [Name] Source #
comparisonAggOperators :: [Name] Source #
mkDescriptionWith :: Maybe PGDescription -> Text -> Description Source #
takeValidTables :: forall b. Backend b => TableCache b -> TableCache b Source #
takeValidFunctions :: forall b. FunctionCache b -> FunctionCache b Source #
requiredFieldParser :: (Functor n, Functor m) => (a -> b) -> m (FieldParser n a) -> m (Maybe (FieldParser n b)) Source #
optionalFieldParser :: (Functor n, Functor m) => (a -> b) -> m (Maybe (FieldParser n a)) -> m (Maybe (FieldParser n b)) Source #
mkEnumTypeName :: forall b m r. (Backend b, MonadReader r m, Has MkTypename r, MonadError QErr m, Has NamingCase r) => EnumReference b -> m Name Source #
Builds the type name for referenced enum tables.
addEnumSuffix :: (MonadReader r m, Has MkTypename r) => GQLNameIdentifier -> Maybe Name -> NamingCase -> m Name Source #
peelWithOrigin :: MonadParse m => Parser 'Both m a -> Parser 'Both m (ValueWithOrigin a) Source #