Skip to content

Express + GraphqlTs #11

@Bennit

Description

@Bennit

Hi Nicolas

First of all: nice work on the library! I prefer this approach over the approach of having to write in the graphql schema language, using a tool to generate typescript interfaces and finally committing these generated interfaces into the git project.

To get it to work with express, and to be able to use @types/graphql, I had to install graphql as a separate dependency. However if you do this, then graphql-express complains about the schema generated by graphqlTs.getSchema() not being a 'proper' GraphQLSchema.
In package.json, via postinstall, I removed the nested version of graphql from node_modules/graphql-ts, making sure that graphql-ts uses the constructor from the graphql dependency I explicitly installed. After this, everything seems to work fine so perhaps a suggestion is to move the dependency to devDependencies in your project and ask for manual installation or to keep the graphql dependency more up to date.

Kind regards
Ben

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions