graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.GraphQL.Schema.Mutation

Synopsis

Documentation

insertIntoTable Source #

Arguments

:: forall b r m n. MonadBuildSchema b r m n 
=> BackendTableSelectSchema b 
=> (TableInfo b -> SchemaT r m (InputFieldsParser n (BackendInsert b (UnpreparedValue b)))) 
-> Scenario 
-> TableInfo b

qualified name of the table

-> Name

field display name

-> Maybe Description

field description, if any

-> SchemaT r m (Maybe (FieldParser n (AnnotatedInsert b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)))) 

Construct the parser for a field that can be used to add several rows to a DB table.

This function is used to create the insert_tablename root field. The field accepts the following arguments: - objects: the list of objects to insert into the table (see tableFieldsInput) - parser for backend-specific fields, e.g. upsert fields on_conflict or if_matched

insertOneIntoTable Source #

Arguments

:: forall b r m n. MonadBuildSchema b r m n 
=> BackendTableSelectSchema b 
=> (TableInfo b -> SchemaT r m (InputFieldsParser n (BackendInsert b (UnpreparedValue b)))) 
-> Scenario 
-> TableInfo b

table info

-> Name

field display name

-> Maybe Description

field description, if any

-> SchemaT r m (Maybe (FieldParser n (AnnotatedInsert b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)))) 

Variant of insertIntoTable that inserts a single row.

Instead of expecting a list of rows to insert in a objects argument, this field instead expects a single object. Its selection set is also slightly different: it only allows selecting columns from the row being inserted.

deleteFromTable Source #

Arguments

:: forall b r m n. (MonadBuildSchema b r m n, AggregationPredicatesSchema b, BackendTableSelectSchema b) 
=> Scenario 
-> TableInfo b

table info

-> Name

field display name

-> Maybe Description

field description, if any

-> SchemaT r m (Maybe (FieldParser n (AnnDelG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)))) 

Construct a root field, normally called delete_tablename, that can be used to delete several rows from a DB table

deleteFromTableByPk Source #

Arguments

:: forall b r m n. MonadBuildSchema b r m n 
=> BackendTableSelectSchema b 
=> Scenario 
-> TableInfo b

table info

-> Name

field display name

-> Maybe Description

field description, if any

-> SchemaT r m (Maybe (FieldParser n (AnnDelG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b)))) 

Construct a root field, normally called delete_tablename_by_pk, that can be used to delete an individual rows from a DB table, specified by primary key. Select permissions are required, as the user must be allowed to access all the primary keys of the table.

mutationSelectionSet :: forall b r m n. MonadBuildSchema b r m n => BackendTableSelectSchema b => TableInfo b -> SchemaT r m (Parser 'Output n (MutFldsG b (RemoteRelationshipField UnpreparedValue) (UnpreparedValue b))) Source #

All mutations allow returning results, such as what the updated database rows look like. This parser allows a query to specify what data to fetch.

primaryKeysArguments :: forall b r m n. MonadBuildSchema b r m n => TableInfo b -> SchemaT r m (Maybe (InputFieldsParser n (AnnBoolExp b (UnpreparedValue b)))) Source #

How to specify a database row by primary key.

This will give Nothing when either there are no primary keys defined for the table or when the given permissions do not permit selecting from all the columns that make up the key.