You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this plugin and the recommended woocommerce plugin. The problem is that ids don't match so when a user logs in I save their id and when they are ready to checkout I query for customer(id: ID) but the problem is that these id's don't match. If you provide the default db id's graphql complains. Shouldn't they share the same ids?
They don't match and this by design for both caching and object resolution. The User and Customer types are two different objects and should be used as such. Most, if not all, of the relative fields are accessible from the Customer type.
If you need more fields from the User type, you have two alternative options.
Add them to the Customer type using register_graphql_types action, and registering the fields using the register_graphql_field() defined in WPGraphQLRecommended
Run a second query using userBy( userId: customerId ). While the relay global IDs, a.k.a. id fields, are different on the two types, the customerId and userId are identical and can be use to query the the type using the customerBy and userBy queries.
If you have any problems you can reach out in Slack in the #woocommerce channel. I'll provide as much help as I can.
I am using this plugin and the recommended woocommerce plugin. The problem is that
ids
don't match so when a user logs in I save their id and when they are ready to checkout I query forcustomer(id: ID)
but the problem is that these id's don't match. If you provide the default db id's graphql complains. Shouldn't they share the same ids?Here is the result of the queries.
The text was updated successfully, but these errors were encountered: