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

feat(GraphQL support): PoC for GraphQL support in datahub-frontend (Queries + Mutations) #2044

Closed

Conversation

jjoyce0510
Copy link
Collaborator

@jjoyce0510 jjoyce0510 commented Dec 21, 2020

This PR includes a proof-of-concept implementation of GraphQL in datahub-frontend. It is related to the open GraphQL RFC PRs:

Once the details in the RFC are agreed upon, we can work to productionalize the first chunk of GQL work using this PR.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

@@ -170,6 +170,7 @@ private ObjectNode userEntityProps() {
*/
@Nonnull

// What is this good for??
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment will probably only add more confusion. Please open a ticket asking about this instead.

My guess is this is code that was exported from internal code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This shouldn't have been in here... will remove

Copy link
Contributor

@jplaisted jplaisted left a comment

Choose a reason for hiding this comment

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

Ack this is a PoC, I was just looking through a little. Didn't do a full review, but left a few comments that stood out to me for a production version.

/**
* Constants relating to GraphQL type system & execution.
*/
public class Constants {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Generally try to avoid overly broad classes like this. Imagine this file 10 years from now being 500 lines of ungrouped constants.

Alternatives:

  • (Preferred) A lot of this seems inference-able from the actual data models. Probably fine for a PoC, but for final code consider refactoring. Maybe contribute something to GMA to help out with this.
  • Have a TypeNames, FieldNames, etc enums or classes to group these constants.

Copy link
Collaborator Author

@jjoyce0510 jjoyce0510 Jan 5, 2021

Choose a reason for hiding this comment

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

"Maybe contribute something to GMA to help out with this." -- Not sure I'm following this suggestion. Are you proposing we use the Rest.li API models exposed by the GMA API to reference particular fields?

Ideally we can find a way to auto-gen POJOs that included easy access to field names and then remove many of these....

Agree that in the long term this could grow unwieldy, but I generally opt for simplicity + centralization until natural boundaries have time to emerge. IMO, the scoping of this class to the GraphQL package is sufficient for now... I'm not super committed though, open to parsing apart if you feel strongly

@@ -9,6 +9,7 @@ source frontend.env
set +a

export JAVA_OPTS="
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: again, remove for final submission.

@jjoyce0510 jjoyce0510 changed the title feat(GraphQL support): PoC for GraphQL support in datahub-frontend feat(GraphQL support): PoC for GraphQL support in datahub-frontend (1/2) - Queries Jan 5, 2021
@jjoyce0510 jjoyce0510 changed the title feat(GraphQL support): PoC for GraphQL support in datahub-frontend (1/2) - Queries feat(GraphQL support): PoC for GraphQL support in datahub-frontend (Queries + Mutations) Jan 5, 2021
return DataLoader.newDataLoader(corpUserBatchLoader);
}

private DataLoader<String, com.linkedin.dataset.Dataset> createDatasetLoader() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Extract these into dedicated classes.

@shirshanka
Copy link
Contributor

Closing this, since we've moved on from the POC to actual implementation.

@shirshanka shirshanka closed this Mar 10, 2021
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.

3 participants