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

BUG: HoC does not work with mutations #1

Open
geekflyer opened this issue Dec 17, 2017 · 2 comments
Open

BUG: HoC does not work with mutations #1

geekflyer opened this issue Dec 17, 2017 · 2 comments

Comments

@geekflyer
Copy link

geekflyer commented Dec 17, 2017

If I try to use the grapqhl hoc with a mutation my app crashes upon initialization with
Uncaught (in promise) Error: Must contain a query definition.

For example:

const createOrgGroupMutation = gql`
    mutation createOrgGroup ($name: String!) {
        createOrgGroup(name: $name) {
            id
        }
    }
`;

export default graphql(createOrgGroupMutation)(CreateOrgGroupDialog);

If I use the graphql hoc from react-apollo this error does not occur.

@tomitrescak
Copy link
Owner

Yeah, that is not implemented. I use mutations differently using the "mutation" construct from this package. As I have usually 4-5 mutations per component that seemed to be a better option. Once I'll have a bit of time I'll look into this.

@geekflyer
Copy link
Author

@tomitrescak which mutation construct are you referring to? could you perhaps create an example? thanks

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