Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Fix name clash b/w 1:1 connections and collections #204

Merged
merged 1 commit into from
Aug 10, 2018

Conversation

SudoBobo
Copy link
Contributor

@SudoBobo SudoBobo commented Aug 9, 2018

Before we could not use the same name for collection and 1:1 connection (or collection and 1:1 multi-head connection variant) because this created two different types with same names in GraphQL schema: Object type for collection and InputObject type for connection. Now we can use the same names, since we add 'result_' to the name of GraphQL collection Object type.

Close #191, close #104

@SudoBobo SudoBobo requested a review from Totktonada August 9, 2018 10:10
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

LGTM.

Don’t forget to update instrospection.test.lua before merge.

Minor comments are below.


local graphql = require('graphql')

box.cfg{ wal_mode = "none" }
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put it because it was in all other /extra tests.
As original author of this tests says, wal_mode = "mode" speed ups tests. But in this test it is useless.
Removed.

Copy link
Member

Choose a reason for hiding this comment

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

Ouch, I didn’t know that this is common way to write extra tests. So, I vote to get it back for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok then.

@@ -373,7 +373,7 @@ function types.convert(state, avro_schema, opts)
if context == nil then
context = {
field_name = nil,
path = {},
path = {'results'}
Copy link
Member

Choose a reason for hiding this comment

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

By the way, I prefer to have dangling commas, it makes further diffs easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, reasonable, fixed as you say.

}
}

local accessor_1 = graphql.accessor_space.new({
Copy link
Member

Choose a reason for hiding this comment

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

Proposed to move to graphql.new.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, fixed.

}
}]])

local accessor_2 = graphql.accessor_space.new({
Copy link
Member

Choose a reason for hiding this comment

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

Proposed to move to graphql.new.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fxd.


test:isnt(gql_wrapper_2, nil)

-- Potential lash between second ("hero_meta_collection") and third
Copy link
Member

Choose a reason for hiding this comment

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

lash → clash

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fxd.

}
}]])

local accessor_3 = graphql.accessor_space.new({
Copy link
Member

Choose a reason for hiding this comment

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

Proposed to move to graphql.new.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fxd.

Before we could not use the same name for collection and
1:1 connection (or collection and 1:1 multi-head connection
variant) because this created two different types with same
names in GraphQL schema: Object type for collection and
InputObject type for connection. Now we can use the same names,
since we add 'result_' to the name of GraphQL collection
Object type.

Close #191, close #104
@SudoBobo SudoBobo merged commit 6056ae7 into master Aug 10, 2018
@SudoBobo SudoBobo deleted the gh-191-name-clash branch August 10, 2018 22:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants