Skip to content

graph/encoding/graphql: add new package for decoding GraphQL output #169

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

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

kortschak
Copy link
Member

Please take a look.

Depends on #168.
Closes #72.

@kortschak kortschak requested review from mewmew and vladimir-ch August 3, 2017 23:32
mewmew
mewmew previously approved these changes Aug 4, 2017
Copy link
Member

@mewmew mewmew left a comment

Choose a reason for hiding this comment

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

LGMT. Happy to see that you are providing support for more input and output formats for the graph representation @kortschak. I don't have experience with graphql since before, so the review comments are more about the general code style rather than specifics related to graphql.

// uidName is the name of the UID field in the source JSON.
uidName string

nodes map[string]graph.Node
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment stating the key of the map; e.g.

// nodes maps from node value to graph node.

Is this comment correct? Are node values unique?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

UIDs are unique in the input text.

if err != nil {
return err
}
value := fmt.Sprint(v)
Copy link
Member

Choose a reason for hiding this comment

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

What does the call to fmt.Sprint do? Can it be replaced with a type assertion for fmt.Stringer?

Copy link
Member Author

Choose a reason for hiding this comment

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

Everything can be represented as a string, fmt.Sprint(v) does this conversion. The two things we are likely to get here are a string or an int. Neither of these implement fmt.Stringer.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.

return err
}
if attr == g.uidName {
value := fmt.Sprint(v)
Copy link
Member

Choose a reason for hiding this comment

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

Same as comment above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same answer.

@kortschak
Copy link
Member Author

PTAL

@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

LGTM

@kortschak
Copy link
Member Author

Can you re-approve please.

@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

I tried to have a look around, but can't find the option to do so in the web UI.

Where to re-approve?

@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

It says

kortschak dismissed mewmew’s stale review via 1b863d0 7 hours ago

and now, the review button is gone for what it looks like.

@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

I think the reason may be the force push,

We went looking everywhere, but couldn’t find those commits.

@kortschak
Copy link
Member Author

You need to be in the files changed tab, where you'll see green "Review changes" button/menu/dialogue. The review is dismissed by any additional push.

@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

You need to be in the files changed tab, where you'll see green "Review changes" button/menu/dialogue. The review is dismissed by any additional push.

Ok, I'll take a look.

@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

For future notes,

@kortschak Did you do a force push, or how did you push the latest incremental commit?

The benefit of uploading incremental commits, is that it is easier to review the changes, then you see the exact lines which change. Also, when the PR is complete, you may hit squash and merge to turn those several commits into a single one.

@kortschak
Copy link
Member Author

It was forced. In this PR there was very minimal change (the changes are visible from the GUI - it's unfortunate githubs git GC is so aggressive in removing those commits - it did not use to be) in addressing the comments - and significantly, the PR would not pass unless rebased onto the changes in #168 merged into master. Normally I do do incremental and retain the history (at least since the addition of the squash option on the GUI).

@kortschak kortschak merged commit c9bf5d0 into master Aug 4, 2017
@kortschak kortschak deleted the graphql branch August 4, 2017 09:00
@mewmew
Copy link
Member

mewmew commented Aug 4, 2017

I see. Thanks for the background.

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.

2 participants