Lightning Talk
@vilvaathibanpb
Lightning Talk
@vilvaathibanpb
schema: https://api.spacex.land/graphql
documents:
- src/**/*.tsx
overwrite: true
watch: false
generates:
./src/types/types.d.ts:
plugins:
- typescript-common
- typescript-client
npm install graphql-code-generator graphql-codegen-typescript-common
npm install graphql-codegen-typescript-client
//package.json
"generate": "gql-gen"
npm run generate
import { GetLaunches } from "./types/types";
// Use it with query
useQuery<GetLaunches.Query>(query);
//apollo.config.js
module.exports = {
client: {
service: {
name: "GQL",
url: "https://api.spacex.land/graphql"
}
}
};
Any questions, Reach out to me
Feedbacks are appreciated as its my first Presentation in Berlin