mutation TypeError: Cannot read property 'modern' of undefined
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I´ve build the following mutation:
```
import {
commitMutation,
graphql
} from 'react-relay';
import { ConnectionHandler } from 'relay-runtime';
import environment from '../../../../environment';
const createMutation = graphql`
mutation CompanyMutation($company: CompanyInput!) {
createCompany(data: $company) {
id
}
}
`
export const createCompany = (company, callback) => {
const variables = {
company: company
}
console.log("Will call mutation");
commitMutation(
environment,
{
createMutation,
variables,
onCompleted: () => {
callback()
},
onError: (error) => {
throw new Error(error)
}
}
)
}
```
That is called from the following component:
```
class CompanyForm extends Component {
handleSave = data => {
createCompany(data, () => console.log('COMPANY CREATED'));
};
render = () => {
return (
);
};
}
export default CompanyForm;
```
I´m getting the following error:

Is this a bug ? What am I doing wrong in my mutation code ?
Contributor guide
Assessment
This issue has not been assessed yet.