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

Add getNodeIdFromTypeAndIdentifiers(nodeId) to build #262

Merged
merged 11 commits into from
Jul 23, 2018

Conversation

wieseljonas
Copy link
Contributor

No description provided.

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

👍

@@ -60,6 +67,10 @@ export default (function NodePlugin(
JSON.stringify([this.getNodeAlias(Type), ...identifiers])
);
},
getTypeAndIdentifiersForNodeId(nodeId) {
Copy link
Member

Choose a reason for hiding this comment

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

Please rename to getTypeAndIdentifiersFromNodeId

@@ -13,15 +13,15 @@ export default async function resolveNode(
$$nodeType,
parseResolveInfo,
nodeFetcherByTypeName,
getTypeAndIdentifiersForNodeId
Copy link
Member

Choose a reason for hiding this comment

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

Missing comma

getNodeType,
graphql: { getNamedType },
} = build;
if (nodeId === "query") {
return $$isQuery;
}
try {
const [alias, ...identifiers] = JSON.parse(base64Decode(nodeId));
const Type = getNodeType(alias);
const { Type, identifiers} = getTypeAndIdentifiersForNodeId(nodeId);
Copy link
Member

Choose a reason for hiding this comment

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

Lint issue for braces.

@@ -30,6 +31,12 @@ export type BuildExtensionNode = {|
Type: GraphQLType,
...identifiers: Array<mixed>
): string,
getTypeAndIdentifiersFromNodeId(
nodeId: GraphQLID
Copy link
Member

Choose a reason for hiding this comment

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

This is just string here; it's already been parsed from GraphQLID

@wieseljonas wieseljonas changed the title Add getTypeAndIdentifiersForNodeId(nodeId) to build Add getNodeIdFromTypeAndIdentifiers(nodeId) to build Jul 23, 2018
@wieseljonas
Copy link
Contributor Author

@benjie I think we are good now

@@ -8,10 +8,11 @@ import type {
} from "../SchemaBuilder";
import resolveNode from "../resolveNode";
import type { ResolveTree } from "graphql-parse-resolve-info";
import type { GraphQLType, GraphQLInterfaceType } from "graphql";
import type { GraphQLType, GraphQLID, GraphQLInterfaceType } from "graphql";
Copy link
Member

Choose a reason for hiding this comment

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

Remove GraphQLID

@@ -30,6 +31,12 @@ export type BuildExtensionNode = {|
Type: GraphQLType,
...identifiers: Array<mixed>
): string,
getNodeIdFromTypeAndIdentifiers(
nodeId: GraphQLID
Copy link
Member

Choose a reason for hiding this comment

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

nodeId: string

@@ -60,6 +67,13 @@ export default (function NodePlugin(
JSON.stringify([this.getNodeAlias(Type), ...identifiers])
);
},
getNodeIdFromTypeAndIdentifiers(nodeId) {
Copy link
Member

Choose a reason for hiding this comment

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

Wait; isn't this getTypeAndIdentifiersFromNodeId rather than getNodeIdFromTypeAndIdentifiers

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

👌 Perfect!

@benjie benjie merged commit 447239d into graphile:master Jul 23, 2018
madtibo pushed a commit to spacefill/graphile-engine that referenced this pull request Dec 7, 2021
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.21.0 to 1.23.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.21.0...v1.23.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

None yet

2 participants