New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing DataLoader for strapi::user
in GraphQL plugin for querying updated_by and created_by
#7334
Comments
Thank you for reporting this issue. |
Yes, I'm hitting the same errors. |
Well I'm not sure how/where to fix this, even though I would love to contribute. But I think I'm onto something... If I go to the Hope you guys can do something with this info :) |
@daanvanham If you are willing to make a PR your are right on point ;) To be honest this info is not meant to be used as a public info though. as it really is meant only for the admin but if you really want to use it go ahead :) |
But I'm not sure where the code should be, adding a model to the
Then why is it in the model? Since you're always an AdminUser if you create content using the Strapi interface. That would mean that |
@daanvanham you need to run The info is in the model as we are using in in the Admin and is usefull in the Admin. What I mean is that it is not meant to be used as an |
…plugin Signed-off-by: Daan van Ham <daan.van.ham@frontmen.nl>
fixed #7334 add the data-loader for admin users to the graphql plugin
Signed-off-by: Daan van Ham <daan.van.ham@frontmen.nl>
…plugin Signed-off-by: Daan van Ham <daan.van.ham@frontmen.nl> Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
Hi @daanvanham Are you in fact using the created_by and updated_by fields ? we are actually thinking of making them private for now to avoid any non wanted data leaks. You can check the conversation here. #7177 |
Hi, yes we are currently using it for one of our applications. But in the conversation I saw a suggestion of one of the users to add a controller which can filter out the unwanted fields. This in my opinion is a better solution to "fix" this "unwanted data leaks issue". Otherwise you'll have to add a user field for the contenttypes you want to have an author field and thus a duplicate user (both admin and non-admin). This feels a bit obsolete. Another solution could be, if you guys want to put it in a feature later on, to make the field configurable. So that you can set it to public/private inside Strapi (the whole User Object or certain parts of the User Object). |
Describe the bug
When I try to add
updated_by
orcreated_by
to my GraphQL query an error returns:"Cannot read property 'load' of undefined"
. It looks like the DataLoader forstrapi::user
is missing (that's thetargetModel.uid
I saw while debugging a bit).Steps to reproduce the behavior
updated_by { id }
orcreated_by { id }
in the queryExpected behavior
I expected there to be an ID of the user that created the content for that content type.
Screenshots
https://ibb.co/BtwPYr3
System
The text was updated successfully, but these errors were encountered: