-
Notifications
You must be signed in to change notification settings - Fork 1
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 support for ARRAY type #3
Add support for ARRAY type #3
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3 +/- ##
==========================================
+ Coverage 27.25% 27.45% +0.20%
==========================================
Files 11 11
Lines 444 448 +4
==========================================
+ Hits 121 123 +2
- Misses 323 325 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
@@ -25,6 +27,8 @@ def get_fields() -> GraphQLFieldMap: | |||
graphql_type: GraphQLOutputType = get_graphql_type_from_column(column) | |||
if not column.nullable: | |||
graphql_type = GraphQLNonNull(graphql_type) | |||
if isinstance(column.type, (ARRAY, PGARRAY)): | |||
graphql_type = GraphQLList(graphql_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense to include this in scalars/get_graphql_type_from_column
directly?
It would have the nice effect of changing the return type of that function to GraphQLOutputType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already tried doing that (was my first attempt) but somehow that function is probably called somewhere else too (I printed the column type and graphql type assigned and when I changed that function it was printed way more than here) and it ended up not working
Replacing this with #4 |
This PR adds support for ARRAY type
PS. was the import ordering incorrect? I just ran
isort -rc .