Resolvers
Overview
code.store platform support file based resolvers. To avoid manual file creation allowed a command cs generate:resolver
, which generate an empty resolver for your query
or mutation
which specified in schema.graphql
file in src directory.
To generate resolver execute cs generate:resolver
CLI command, select resolver type: mutation or query and and specify a name:
Also, you can use flags:
-t resolver type, one of: 'query' or 'mutation'
-n resolver name
-f force overwrite file if it already exists
For example, here a command from previous example: cs generate:resolver -t query -n hello
After command execution will be generated file get.hello.ts
in src/rest
directory:
More information about resolver method and his params can be found in GraphQL section.
Last updated