ianibo opened a new issue, #14500:
URL: https://github.com/apache/grails-core/issues/14500

   heya - 2.0.0 looks really good and MultiTenancy support is definitely better 
- out of the box confirmed working with Database-Per-Tenant mappings too - so 
that's great.
   
   Trying to add in a custom data fetcher when working in Multi-Tenancy mode 
seems to encounter a similar problem to v1 with static access at applicaiton 
startup:
   
   `
   org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'graphQL': Cannot resolve reference to bean 'graphQLSchema' while 
setting constructor argument; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'graphQLSchema': Bean instantiation via factory method failed; nested 
exception is org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [graphql.schema.GraphQLSchema]: Factory method 'generate' threw 
exception; nested exception is 
org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException: 
Tenant could not be resolved outside a web request`
   
   The project works perfectly with the out-of-the-box config until we declare 
a custom fetcher (Simplified example):
   
   
       static graphql = GraphQLMapping.lazy {
         query('generalAlertBaseQuery', pagedResult(AlertBase)) {
           defaultListArguments()
           argument('qterm', String) {
             nullable true
             description "Left anchored alert name to search for"
           }
           dataFetcher(new 
PaginatedEntityDataFetcher<List<AlertBase>>(AlertBase.gormPersistentEntity)     
{
             @Override
             protected DetachedCriteria buildCriteria(DataFetchingEnvironment 
environment) {
               def q = new DetachedCriteria(AlertBase).build {
                 rlike('name',/${environment.getArgument('qterm')}/)
               }
               return q
             }
           })
         }
       }
   
   
   This code is yanked directly from a v1 test rig, and I've only scanned over 
the updated 2.0.0 docs so apologies if I've missed something critical.
   
   Is it possible that custom fetchers can be made to work in the multi-tenant 
setup? WIll try and update the test project to recreate this in a simple env.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to