cancel
Showing results for 
Search instead for 
Did you mean: 

setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

Spoiler
Spoiler
Hello everyone, i am having this problem and can't solve. Can you give me a hand? thank you

 

Fatal error: Declaration of Magento\GraphQl\Model\Query\ContextInterface::getUserType(): ?int must be compatible with Magento\Framework\GraphQl\Query\Resolver\ContextInterface::getUserType(): int in public_html/vendor/magento/module-graph-ql/Model/Query/ContextInterface.php on line 20
 

 

5 REPLIES 5

Re: setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

Hi @famedesign 

 

Seems like you tried to extend any class but there is issue with extended class, please share code or check once.

If you have added any extension, check if any class is using this function getUserType(): ?int

if you find this anywhere, remove ? from this code.

 

Hope it helps ~

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

thank you very much for the answer ...
but how can i see and find the function in one of the extensions .. is there a command?

Re: setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

@famedesign Do you have an override of Magento\GraphQl\Model\Query\ContextInterface?

Because somewhere in 2.3, the interface for the execute method had an argument that changed from Magento\Framework\GraphQl\Query\Resolver\ContextInterface to Magento\GraphQl\Model\Query\ContextInterface. If you ever overrode that method, then you will need to update the $context argument to match the class specified in the interface.

 

Hope it helps!

 

Thanks

Re: setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

@famedesign 

 

you can just disable module one by one and can try to run di:compile everytime :

to disable module, run this command from docroot in command line :

php bin/magento module:disable MODULE_NAME

and to enable it back, run this command :

php bin/magento module:enable MODULE_NAME
Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: setup:di:compile fatal error Magento\GraphQl\Model\Query\ContextInterface::getUserType()

@famedesign use the below command to check if this file is overridden in some custom extension.

 

grep -r "GraphQl" app/code/

Let me know the search result.

 

Thanks