Use type ID for primary key instead of String.

Fixes #1356.
This commit is contained in:
Daan De Deckere 2018-06-09 19:36:36 +02:00 committed by Daan De Deckere
parent 92a3c453b7
commit 732038593f

View File

@ -424,7 +424,7 @@ module.exports = {
// Setup initial state with default attribute that should be displayed
// but these attributes are not properly defined in the models.
const initialState = {
[model.primaryKey]: 'String!'
[model.primaryKey]: 'ID!'
};
const globalId = model.globalId;
@ -509,7 +509,7 @@ module.exports = {
if (_.isFunction(queries[type])) {
if (type === 'singular') {
Object.assign(acc.query, {
[`${pluralize.singular(name)}(id: String!)`]: model.globalId
[`${pluralize.singular(name)}(id: ID!)`]: model.globalId
});
} else {
Object.assign(acc.query, {