Open jacksonkasi1 opened 2 months ago
Please check this to reproduce the issue: https://github.com/jacksonkasi1/drizzle-graphql-lambda
Seems like it's not the intended way to use .getFields()
in the first place, but I'll investigate if there's something I can do about it from my side, sure.
Thanks for looking into it, @Sukairo-02
Description:
When attempting to extend a
GraphQLObjectType
using fields fromdrizzleEntities.types.UsersItem.getFields()
indrizzle-graphql
, the following error occurs:This issue appears when trying to spread the fields from
drizzleEntities.types.UsersItem.getFields()
into a newGraphQLObjectType
to extend it.Steps to Reproduce:
drizzle-graphql
.drizzleEntities.types.UsersItem.getFields()
as follows:Expected Behavior:
The
ExtendedUsersItem
type should be successfully created by extending the fields fromUsersItem
and adding custom fields liketotalPoints
without causing any errors.Actual Behavior:
The server throws an error indicating that the
id
field (or other fields) "must be an object with argument names as keys." This suggests thatgetFields()
may not be handling or returning the fields in a way that is compatible with the expectedGraphQLFieldConfigMap
.Environment:
^0.8.4
^0.33.0
^16.9.0
Additional Context:
ExtendedUsersItem
type.getFields()
interacts withdrizzle-graphql
.Temporary Workaround:
Manually adding the fields from
UsersItem
instead of usinggetFields()
works without errors, but this is not ideal for maintaining the schema as it requires manual updates when fields change.Request:
Please investigate whether there is a compatibility issue with
getFields()
when usingdrizzle-graphql
, or if there are specific steps that should be taken to avoid this error.