kepawni / apollo-cli

Use Apollo client tools like codegen despite working in an up-to date Node.js/npm environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

apollo-cli

Use Apollo client tools like codegen despite working in an up-to date Node.js/npm environment

How to use

The working directory is /home/node and you can mount your project directory to it. Then you can call all apollo commands from the container. See Apollo CLI documentation for details.

I most often use the code generator in watch mode to automatically generate TypeScript types for the GraphQL queries in my projects, which looks like this:

docker run --rm -it -v "$PWD":/home/node kepawni/apollo-cli:latest \
    apollo client:codegen \
        --target typescript \
        --localSchemaFile schema.graphqls \
        --outputFlat \
        --includes 'src/**/*.ts*' \
        --excludes='src/generatedTypes.ts' \
        --watch \
        'src/generatedTypes.ts'

About

Use Apollo client tools like codegen despite working in an up-to date Node.js/npm environment


Languages

Language:Dockerfile 100.0%