Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Regression: 2.3.0 returns null for all fields #189

Closed
wheresrhys opened this issue Feb 7, 2019 · 9 comments
Closed

Regression: 2.3.0 returns null for all fields #189

wheresrhys opened this issue Feb 7, 2019 · 9 comments

Comments

@wheresrhys
Copy link

wheresrhys commented Feb 7, 2019

Pinning to 2.2.0 fixes the issue.

neo4j version: 3.5 community
node version: 8.x
bolt driver version: 1.7.2
apollo version: 1.4.0

I'm about to go on holiday, so no time to prepare a reduced test case. The tests in our private repo surface the issue though. I'll ask about giving someone from neo4j access to the codebase if you're interested in digging around

cc @GeoffThorpeFT

@johnymontana
Copy link
Contributor

Yikes - that's not good :-\

Are you getting any error messages?

Yes, please share any code you can with me and I'll try to reproduce.

@wheresrhys
Copy link
Author

Can you access this now https://github.com/Financial-Times/biz-ops-api?

I will prepare a guide to running tests without access to creds

@johnymontana
Copy link
Contributor

@wheresrhys Yes, thanks - I can access biz-ops-api, but it looks like I'll also need access to biz-ops-schema for the typedefs and resolvers?

@wheresrhys
Copy link
Author

wheresrhys commented Feb 7, 2019

that's an npm module though, so should be installed when running npm install

The only env variables you should need (I think) are

HEROKU_API_URL=http://localhost:8888
NEO4J_BOLT_URL=bolt://localhost:7687

all stored in .env.

you may need to create dummy values for any of the following, though real values shouldn't be needed for tests

API_KEY
AWS_ACCESS_KEY_ID
AWS_ACCOUNT_ID
AWS_SECRET_ACCESS_KEY
AWS_USER_ARN
BIZ_OPS_API_URL
CRUD_EVENT_LOG_STREAM_NAME
DISABLE_READS
DISABLE_WRITES
ENVIRONMENT
ENVIRONMENT_TAG
FT_API_GATEWAY_KEY
FT_API_GATEWAY_URL
HEROKU_API_URL
NEO4J_BOLT_PASSWORD
NEO4J_BOLT_URL
NEO4J_BOLT_USER
NEO4J_URL

Also replace the test task in makefile with

test:
	jest test/graphql.spec.js

To avoid unnecessary noise

Thanks for taking a look

@johnymontana
Copy link
Contributor

Thanks. I was able to reproduce and I think we've found the cause. The v2.3.0 release includes a feature to ignore fields that may be resolved from external sources outside of Neo4j and not include those fields in the generated Cypher query (via a @neo4j_ignore schema directive) . We also include some logic to detect if a resolver is already provided for a field and then add the @neo4j_ignore directive so that field level resolver can be called and excluded from the generated Cypher query.

However, in your case it seems that since a logger was included in the call to makeExecutableSchema, that logger is distributed across every field in the resolve path of the AST, and we incorrectly assume that a resolver has been provided for that field and assign the @neo4j_ignore directive, thus excluding almost all fields from the Cypher query.

We're working on a fix (will be removing this inferring functionality and only handle explicitly specified @neo4j_ignore directives) and should have it released soon.

@johnymontana
Copy link
Contributor

A fix for this is available now in v2.3.1. Please let us know if this resolves the issue.

@wheresrhys
Copy link
Author

Excellent, will hopefully give it a go today or early next week

@wheresrhys
Copy link
Author

Yep - issue fixed. Thanks for the speedy response, and looking forward to using the improved ordering behaviour (which I believe is in 2.3.x?)

@johnymontana
Copy link
Contributor

Great - glad that worked. Sorry for introducing the bug!

Yes, nested ordering is now supported in 2.3.x 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants