Closed galki closed 4 years ago
graphql-sequelize doesn't support generating GraphQLID
at all.
commonly because you want a global id anyways.
not too familiar with global ids, but are those for relay only?
They are used by any client with the concept of "nodes", that includes relay yes.
An argument could be made for graphql-sequelize returning GraphQLID for primaryKey: true
.
PR welcome, can be merged & published as a major bump.
alright. can you at least reopen this issue please?
@mickhansen im gonna go with number 2 but if you have another preference, please let me know.
attribute.primaryKey
to typeMapper.toGraphQL
orps: im planning to do this for UUID and INTEGER
Option #2, typeMapper is just supposed to look at types
FYI globalId: true
doesnt seem to work for InputTypes:
Error: ProjectUserInput.id field type has a resolve property, but Input Types cannot define resolvers.
and input types are the only place i find myself doing this id hack:
export default models => new GraphQLInputObjectType({
name: 'ProjectUserInput',
fields: () => Object.assign(attributeFields(
models.ProjectUser, { exclude: ['projectId'] }
), {
id: { type: GraphQLID },
}),
})
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
apparently graphql-sequelize treats UUID fields as
GraphQLString
but mutations dont work this way. i have to do the below hack to make it work:graphql-sequelize: 5.4.2 sequelize: 4.13.2