Skip to content
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

DefaultGormDataFetcher does not work for domains with not default datastore #31

Closed
armsargis opened this issue Jul 23, 2019 · 3 comments
Assignees
Milestone

Comments

@armsargis
Copy link

If I define domain with not default datastore like:

class Speaker {

    String firstName
    String lastName
    String name
    String email
    String bio

    static graphql = GraphQLMapping.build {
        operations.delete.enabled false
        //or
        //operations.get
        //operations.list
        //operations.count
        //operations.create
        //operations.update
        //operations.delete
    }

    static constraints = {
        email nullable: true, email: true
        bio nullable: true
    }

    static mapping = {
        datasource "rimm"  // <------ here

        bio type: 'text'
        name formula: 'concat(FIRST_NAME,\' \',LAST_NAME)'
        talks sort: 'id'
    }

}

I am getting error like:

curl -X "POST" "http://localhost:8080/graphql" \                                                                                                52 ↵  
     -H "Content-Type: application/graphql" \
     -d $'
{
  speakerCount
}'
{"data":{"speakerCount":null},"errors":[{"message":"Exception while fetching data (/speakerCount) : Class org.grails.gorm.graphql.fetcher.DefaultGormDataFetcher can not access a member of class org.grails.orm.hibernate.HibernateDatastore$2 with modifiers \"public volatile\"","errorType":"DataFetchingException","locations":[{"line":3,"column":3}]}]}
@armsargis
Copy link
Author

Hi I sent PR: #32

@puneetbehl puneetbehl self-assigned this Mar 17, 2020
@puneetbehl puneetbehl added this to the 2.0.0 milestone Mar 25, 2020
@puneetbehl
Copy link
Contributor

@armsargis Could you please look into https://github.com/puneetbehl/graphqlnondefaultdb where I am trying to replicate the problem but seems to be working fine.

@puneetbehl
Copy link
Contributor

Closing due to lack of feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants