Skip to content

Commit

Permalink
fix(node): change nodeIdFieldName to 'id' (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Jul 28, 2017
1 parent 3d5b8dd commit 1df0743
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`generated schema 1`] = `
# An object with a globally unique \`ID\`.
interface Node {
# A globally unique identifier. Can be used in various places throughout the system to identify this single value.
nodeId: ID!
id: ID!
}
# The root query type which gives access points into the data universe.
Expand All @@ -21,12 +21,12 @@ type Query implements Node {
query: Query!
# The root query type must be a \`Node\` to work well with Relay 1 mutations. This just resolves to \`query\`.
nodeId: ID!
id: ID!
# Fetches an object given its globally unique \`ID\`.
node(
# The globally unique \`ID\`.
nodeId: ID!
id: ID!
): Node
enum: MyEnum
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type DummyEdge {
# An object with a globally unique \`ID\`.
interface Node {
# A globally unique identifier. Can be used in various places throughout the system to identify this single value.
nodeId: ID!
id: ID!
}
# The root query type which gives access points into the data universe.
Expand All @@ -75,12 +75,12 @@ type Query implements Node {
query: Query!
# The root query type must be a \`Node\` to work well with Relay 1 mutations. This just resolves to \`query\`.
nodeId: ID!
id: ID!
# Fetches an object given its globally unique \`ID\`.
node(
# The globally unique \`ID\`.
nodeId: ID!
id: ID!
): Node
dummyConnection(first: Int, after: Cursor, sortBy: DummyConnectionSortBy): DummyConnection
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`generated schema n = 0, n = 3 1`] = `
# An object with a globally unique \`ID\`.
interface Node {
# A globally unique identifier. Can be used in various places throughout the system to identify this single value.
nodeId: ID!
id: ID!
}
# The root query type which gives access points into the data universe.
Expand All @@ -18,12 +18,12 @@ type Query implements Node {
query: Query!
# The root query type must be a \`Node\` to work well with Relay 1 mutations. This just resolves to \`query\`.
nodeId: ID!
id: ID!
# Fetches an object given its globally unique \`ID\`.
node(
# The globally unique \`ID\`.
nodeId: ID!
id: ID!
): Node
dummy: Dummy0
}
Expand All @@ -38,7 +38,7 @@ exports[`generated schema n = 0, n = 3 2`] = `
# An object with a globally unique \`ID\`.
interface Node {
# A globally unique identifier. Can be used in various places throughout the system to identify this single value.
nodeId: ID!
id: ID!
}
# The root query type which gives access points into the data universe.
Expand All @@ -48,12 +48,12 @@ type Query implements Node {
query: Query!
# The root query type must be a \`Node\` to work well with Relay 1 mutations. This just resolves to \`query\`.
nodeId: ID!
id: ID!
# Fetches an object given its globally unique \`ID\`.
node(
# The globally unique \`ID\`.
nodeId: ID!
id: ID!
): Node
dummy: Dummy3
}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-build/src/plugins/NodePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default (function NodePlugin(
) {
const nodeIdFieldName: string = inNodeIdFieldName
? String(inNodeIdFieldName)
: "nodeId";
: "id";
builder.hook("build", (build: Build): Build & BuildExtensionNode => {
const nodeFetcherByTypeName = {};
const nodeAliasByTypeName = {};
Expand Down

0 comments on commit 1df0743

Please sign in to comment.