Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LoadDefaultConfig to load the schema by default #1134

Merged

Conversation

seriousben
Copy link
Contributor

@seriousben seriousben commented Apr 5, 2020

When gqlgen gen falls back to the DefaultConfig, the generated code does not have any models, queries or mutations.

The reason is that the default schema.graphql is never loaded. api.Generate is called with an empty list of ast.Source.

This PR changes the gen command to properly generate code based on the default config.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)
    • There was no documentation to update that I could see.

@stale
Copy link

stale bot commented Jun 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 4, 2020
@mtibben mtibben removed the stale label Jun 11, 2020
@vektah
Copy link
Collaborator

vektah commented Jul 26, 2020

Thanks, looks good 👍

@vektah vektah merged commit 39a12e0 into 99designs:master Jul 26, 2020
@seriousben seriousben deleted the fix-default-config-no-ast-sources branch July 26, 2020 11:42
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
…no-ast-sources

Add LoadDefaultConfig to load the schema by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants