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

Fix apollo-server null issue due to missing columns #444

Merged
merged 1 commit into from Apr 30, 2021

Conversation

zachrdz
Copy link
Contributor

@zachrdz zachrdz commented Apr 4, 2021

By submitting a PR to this repository, you agree to the terms within the Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Recent apollo-server-core changes always define a field resolver (see enablePluginsForSchemaResolvers function, apollo-server issue #3988) so '!field.resolve' is not a good check for columns. Because of this, the query is not built correctly and does not included the requested columns, leading to all fields being null when using ApolloServer. Instead use parentTypeNode.constructor.name.

Current condition

if (fieldConfig.sqlColumn || !field.resolve)

Proposed condition

if (fieldConfig.sqlColumn || ['GraphQLObjectType', 'GraphQLInterfaceType'].includes(parentTypeNode.constructor.name))

References

Reference to existing PR in draft state

Apollo Server breaking change

Testing

Modified an existing test for User > favNums resolver to add ignoreAll since it does not use join-monster functionality.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR via comments and by updating the change log
  • All active GitHub checks for tests, formatting, and security are passing

@zachrdz
Copy link
Contributor Author

zachrdz commented Apr 4, 2021

This build should be passing, but it looks like pull requests from forks aren't allowed to run the linter which is causing the build to fail. May someone with permission please manually run this step?

@zachrdz zachrdz mentioned this pull request Apr 4, 2021
Closed
@AlessandroFerrariFood
Copy link

Someone can merge this very important fix?
Thanks!

@alexbbt alexbbt requested a review from lorensr April 30, 2021 03:33
Copy link
Contributor

@alexbbt alexbbt left a comment

Choose a reason for hiding this comment

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

Looks good, I will merge this, just one thing to fix

package.json Outdated Show resolved Hide resolved
@alexbbt
Copy link
Contributor

alexbbt commented Apr 30, 2021

I've got a PR to fix the Linting and Task action, Ill have you rebase one more time after this to pick it up: #449

Recent apollo-server-core changes always define a field resolver (see the enablePluginsForSchemaResolvers function, apollo-server issue #3988) so '!field.resolve' is not a good check for columns. Instead use parentTypeNode.constructor.name.

Incremented release version and updated change log.
@alexbbt
Copy link
Contributor

alexbbt commented Apr 30, 2021

I have no idea why the actions are not working still, but we can go ahead and merge this anyways. Our publish of the new version may be delayed as our publish pipeline recently broke. We will get this published asap.

@alexbbt
Copy link
Contributor

alexbbt commented Apr 30, 2021

So it turns out this is because your fork branch name is master. wearerequired/lint-action#13 (comment). These should work on other branches

@alexbbt alexbbt merged commit ec35fda into join-monster:master Apr 30, 2021
@zachrdz
Copy link
Contributor Author

zachrdz commented Apr 30, 2021

Awesome, thank you!

@alexbbt
Copy link
Contributor

alexbbt commented May 1, 2021

@zachrdz this should be deployed now! Let us know if you have any problems with it!

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.

None yet

3 participants