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
[Bug]: DataHub not working in test Env #836
Comments
Thank you for reporting this. |
Run in test env and try to execute any query. |
Unfortunately I couldn't reproduce, it would be helpful if you could provide more insights. |
what happens if you enable this for you:
|
I've just checked again, it doesn't do that for an out-of-the box setup. We added our own datahub provider that extends the graphql one. Basically allowing us to add custom configs and modify the query set. It only happens when you do that. If you are interested, I can give you access to the repo. It's private. |
not true, after further investigation, it also happens without my bundle when using a graphql config with documents enabled and framework.test enabled. this config fails for me: pimcore_data_hub:
configurations:
test:
general:
active: true
type: graphql
name: test
description: ''
group: ''
sqlObjectCondition: ''
modificationDate: 1708453670
path: null
createDate: 1708453186
schema:
queryEntities: { }
mutationEntities: { }
specialEntities:
document:
read: true
create: false
update: false
delete: false
document_folder:
read: false
create: false
update: false
delete: false
asset:
read: true
create: false
update: false
delete: false
asset_folder:
read: false
create: false
update: false
delete: false
asset_listing:
read: false
create: false
update: false
delete: false
object_folder:
read: false
create: false
update: false
delete: false
translation:
read: false
create: false
update: false
delete: false
translation_listing:
read: false
create: false
update: false
delete: false
coreshop_frontend:
read: true
create: false
update: false
delete: false
security:
method: datahub_apikey
apikey:
- f3025c050b6e7934c33a737a2ab5069d
skipPermissionCheck: false
disableIntrospection: false
workspaces:
asset: { }
document: { }
object:
-
read: true
cpath: /
create: false
update: false
delete: false
id: extModel1438-1
permissions:
user: { }
role: { }
|
@kingjia90 Its a test setup, so config might be messed up due to testing ;) I also don't know what is going on... But whatever it is, it should be fixed. It makes it quite uncomfortable to test with data-hub with these weird issues. |
Did that emerge recently, or has it always been that way? |
no idea |
I was just about to report this issue for We had this issue before, it's due to the fact the type map is kept around between (test) requests, but the type objects are created again and again, I'm not sure exactly why that is. We've workaround it by doing something like this private static ?InputObjectType $type = null;
public function getGraphQlMutationOperatorConfig($nodeDef, $class = null, $container = null, $params = []): array
{
return [
'arg' => ['type' => Type::listOf(self::$type ??= new InputObjectType([
// etc... Since the instance of the type is kept around somewhere and then the type map is checked for name and instance in We had this issue even with regular use, not just in tests, if the same operator was assigned multiple times. |
Expected behavior
should wortk
Actual behavior
not working
Steps to reproduce
run it in test env and you see:
It comes down the following:
config_test.yaml
framework.test
to trueI didn't really quite understand why this service is instantiated twice and why it works when its inlined. here is the GraphQlService from inlined vs not:
Not Inlined:
Inlined
You can see that the EmailType get's instantiated twice, in both cases. But I did not understand why one works and the other doesn't. Anyhow: That service should always only get instantiated once anyway. So there is an issue with the service declaration somewhere.
The text was updated successfully, but these errors were encountered: