-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Conversation
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.
👍
@@ -60,6 +67,10 @@ export default (function NodePlugin( | |||
JSON.stringify([this.getNodeAlias(Type), ...identifiers]) | |||
); | |||
}, | |||
getTypeAndIdentifiersForNodeId(nodeId) { |
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.
Please rename to getTypeAndIdentifiersFromNodeId
@@ -13,15 +13,15 @@ export default async function resolveNode( | |||
$$nodeType, | |||
parseResolveInfo, | |||
nodeFetcherByTypeName, | |||
getTypeAndIdentifiersForNodeId |
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.
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); |
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.
Lint issue for braces.
@@ -30,6 +31,12 @@ export type BuildExtensionNode = {| | |||
Type: GraphQLType, | |||
...identifiers: Array<mixed> | |||
): string, | |||
getTypeAndIdentifiersFromNodeId( | |||
nodeId: GraphQLID |
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.
This is just string
here; it's already been parsed from GraphQLID
@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"; |
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.
Remove GraphQLID
@@ -30,6 +31,12 @@ export type BuildExtensionNode = {| | |||
Type: GraphQLType, | |||
...identifiers: Array<mixed> | |||
): string, | |||
getNodeIdFromTypeAndIdentifiers( | |||
nodeId: GraphQLID |
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.
nodeId: string
@@ -60,6 +67,13 @@ export default (function NodePlugin( | |||
JSON.stringify([this.getNodeAlias(Type), ...identifiers]) | |||
); | |||
}, | |||
getNodeIdFromTypeAndIdentifiers(nodeId) { |
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.
Wait; isn't this getTypeAndIdentifiersFromNodeId
rather than getNodeIdFromTypeAndIdentifiers
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.
👌 Perfect!
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>
No description provided.