TodoItemDTO
ArgsTypes
QueryArgsType
Args type used inread endpoints to allow filtering, paging, and sorting.
The QueryArgsType will generate an ArgsType that will require the user to provide three arguments.
filter?- A filter that should be used to find records to update. See FilterTypepaging?- Options to page of result.sorting?- Optional array to allow sorting of results. See SortType.
Usage
ObjectTypes
ConnectionType
Implementation of connections. Useful for large result sets where the end user should be able to page through the results.Usage
- Code
- Schema
UpdateManyResponseType
Response fromupdateMany mutations.
Usage
- Code
- Schema
DeleteManyResponseType
Response fromdeleteMany mutations.
Usage
- Code
- Schema
InputTypes
FilterType
GraphQL implementation of the@ptc-org/nestjs-query-core Filter type.
The FilterType is dynamically created based on the fields in the DTO annotated with @FilterableField.
Along with the dynamically create fields filter also has the following static fields:
-
and- Allows for joining multipleFilterswith using anANDcondition. For example, find all todo items thatstart with 'Foo' AND end in 'Bar'. -
or- Allows for joining multipleFiltersusing anORcondition. For example, find all todo items that(are completed AND start with 'Foo') OR (are not completed and end in 'Bar').
- Code
- Schema
SortType
TheSortType allows you to sort results.
NOTE This type is automatically created when using QueryArgsType.
For more comprehensive examples take a look at the Sorting Docs
Fields
field- The field to sort on. The is an ENUM of @FilterableFields defined in the DTO.direction- The direction to sort the fieldASCorDESC.nulls?- On supported storage engines you can specify the null sort orderNULLS_FIRST,NULLS_LAST
- Code
- Schema
CreateOneInputType
Input type forcreateOne mutations.
NOTE Dont forget to annotate your DTO with @InputType() from @nestjs/graphql.
NOTE Your DTO should be one that you want to use for input. For example you may not want to let the end user to specify the created or updated fields so you would create a new DTO just for input.
Usage
CreateManyInputType
Input type forcreateMany mutations.
NOTE Dont forget to annotate your DTO with @InputType() from @nestjs/graphql.
NOTE Your DTO should be one that you want to use for input. For example you may not want to let the end user to specify the created or updated fields so you would create a new DTO just for input.
Usage
UpdateOneInputType
InputType type forupdateOne mutations.
The UpdateOneInputType will generate an InputType that will require the user to provide two fields.
id- The id of the record to updateupdate- A record with fields to update.
Dont forget to annotate your DTO with
@InputType() from @nestjs/graphql.Your DTO should be one that you want to use for updates. For example you may not want to let the end user to update the
created or updated fields so you would create a new DTO just for updates.Usage
UpdateManyInputType
Input type forupdateMany mutations.
The UpdateOneInputType will generate an InputType that will require the user to provide two arguments.
filter- The filter that should be used to find records to update. See FilterTypeupdate- The update to apply to each record found.
@InputType() from @nestjs/graphql.
NOTE Your DTO should be one that you want to use for input. For example you may not want to let the end user to specify the created or updated fields so you would create a new DTO just for input.
Usage
In this example we use the read DTO for the FilterType, and a different update DTO.DeleteOneInputType
InputType type fordeleteOne mutations.
The DeleteOneInputType will generate an InputType that will require the user to provide the id of the record to delete.
Usage
DeleteManyInputType
Input type type fordeleteMany mutations.
The DeleteManyInputType will generate an InputType that will require the user to provide:
filter- A filter used to find records to delete. See FilterType