1.0.0 • Published 5 years ago
caa-common v1.0.0
caa-common
This is the common package which can be used by backend and frontend. This package currently provides typescript tpyes that are generated from graphql schema. Both backend and frontend should be using these types in order to have type safety.
Generating types from schema.graphql
When there is a change in schema.graphql
types.ts
file must me re-generated. That's how we have got typescript types from graphql types. To run the generation simply run the following command inside caa-common
folder.
npm run generate
Using caa-common in backend & frontend
For the moment you can add caa-common
as dependency by path:
(assuming caa-common
folder is next to your actual project folder)
...
"dependencies": {
...
"caa-common": "file:../caa-common"
...
}
...
After this you can use types from caa-common
as usual:
import { Profile } from 'caa-common';
1.0.0
5 years ago