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

Only Inject Builtin Scalars if Defined in Schema #635

Merged
merged 3 commits into from
Mar 18, 2019

Conversation

mathewbyrne
Copy link
Contributor

@mathewbyrne mathewbyrne commented Mar 18, 2019

Fixes #629

There was an issue where defining Time (and Map) in the schema as object types caused a panic. This was due to InjectBuiltins attempting to inject a scalar type into the TypeMap. This updates the injection to only happen if the scalar types are defined.

Worth noting that InjectBuiltins is called twice, once in modelgen and again in BuildData shortly after. May be worth fixing this so that there is only a single call.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@mathewbyrne mathewbyrne force-pushed the fix-inject-builtin-scalars branch from ae14198 to d10e048 Compare March 18, 2019 05:27
@mathewbyrne mathewbyrne requested a review from vektah March 18, 2019 05:30
Copy link
Collaborator

@vektah vektah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mathewbyrne mathewbyrne merged commit 8ac8a1f into master Mar 18, 2019
@vektah vektah deleted the fix-inject-builtin-scalars branch March 18, 2019 06:10
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
…alars

Only Inject Builtin Scalars if Defined in Schema
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.

[Proposal] Panic message can be improve when schema type name is not compatible
2 participants