gql-gen runs without errors but no output generated
See original GitHub issueDescribe the bug
The code generator is being run via npm run generate
as recommended in your documentation. I have added this to my package.json
file:
"scripts": {
"generate": "gql-gen"
}
The generator seems to complete without any errors however there is no output file generated.
To Reproduce Steps to reproduce the behavior:
- Use
schema.graphql
shown below - Use
codegen.yml
shown below - Run the following command:
npm run generate
and you will see output similar to this:
hub > npm run generate
> hub@0.0.0 generate /Users/anjumnaseer/workspace/angular/hub
> gql-gen
✔ Parse configuration
✔ Generate outputs
Expected behavior
I expect to find the file schema-types.d.ts
.
Schema/Documents
type Todo {
id: ID!
createdBy: String!
todo: String!
urgent: Boolean
}
type Query {
todos: [Todo!]!
todo(id: ID!): Todo!
}
type Mutation {
addTodo(todo: String!, urgent: Boolean = false): Todo
@aws_auth(cognito_groups: ["God", "Admin"])
deleteTodo(id: ID!): Todo!
@aws_auth(cognito_groups: ["God"])
}
type Subscription {
addedTodo: Todo
@aws_subscribe(mutations: ["addTodo"])
deletedTodo: Todo
@aws_subscribe(mutations: ["deleteTodo"])
}
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
directive @aws_auth(cognito_groups: [String]!) on FIELD_DEFINITION
directive @aws_subscribe(mutations: [String]!) on FIELD_DEFINITION
codegen.yml
schema: ./schema.graphql
overwrite: true
generates:
./schema-types.d.ts:
plugins:
- typescript-common
- typescript-client
- typescript-apollo-angular
Environment:
- OS: Mac Mojave 10.14.1
- Codegen: “graphql-code-generator”: “^0.14.3”, “graphql-codegen-typescript-apollo-angular”: “^0.14.3”, “graphql-codegen-typescript-client”: “^0.14.3”, “graphql-codegen-typescript-common”: “^0.14.3”,
- Node: v8.11.3
Additional context N/A
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
gqlgen/Lobby - Gitter
Novice question I couldn't find an answer for - say I have a graphql schema file that I generate golang code from. I...
Read more >Building GraphQL servers in golang - gqlgen
If you run into this error package github.com/99designs/gqlgen: no Go files while executing the generate command above, follow the instructions in this comment ......
Read more >Trying to write a custom rule
I'm trying to write a custom rule for gqlgen. The idea is to run it to generate Go code from a GraphQL schema....
Read more >How To Build a GraphQL API With Golang to Upload Files ...
If you do not have one, sign up for a new account. ... Running the gqlgen command above generates a server.go file for...
Read more >GraphQL Code Libraries, Tools and Services
A simple and flexible JavaScript GraphQL client that works in all JavaScript ... No more render props hell; ⏳ Handle loading and error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kamilkisiela D’oh! Thanks for pointing out my obvious mistake. I changed documents to point to where I have defined all my
gql
queries and everything works perfectly now. I think termdocuments
threw me a bit but now I understand it fully.Many thanks for your patience.
@kamalgill I have ran into a similar problem above. Generator output says everything passed, but no code was generated. I’m generating a .ts code file, I don’t have any documents?
My config looks like: