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

Failed to compile #25

Open
vamsi981 opened this issue Apr 13, 2019 · 3 comments
Open

Failed to compile #25

vamsi981 opened this issue Apr 13, 2019 · 3 comments

Comments

@vamsi981
Copy link

Failed to compile with the below error
C:/Work/MB/clientBi/src/controllers/modules/ChangePasswordController/index.tsx
Property 'data' does not exist on type 'void | FetchResult<ForgotPasswordChangeMutation, Record<string, any>, Record<string, any>>

@klaaz0r
Copy link

klaaz0r commented Apr 13, 2019

Hey! I just had the same error. I haven't fixed it yet but I know where it comes from.

You can set "react-apollo": "2.1.6", so npm/yarn uses the fixed version instead of the latest stable. This should at least help you getting started for now! Once I have a final solution I will post it 👍

@benawad
Copy link
Owner

benawad commented Apr 13, 2019

Instead of

const {
      data: { forgotPasswordChange }
    } = await this.props.mutate({
      variables: values
    });

try:

const response = await this.props.mutate({
      variables: values
    });

if (!response || !response.data) {
    return null;
}

const {
      data: { forgotPasswordChange }
    } = response

@vamsi981
Copy link
Author

@benawad I tried by what you mention above, it worked but the problem is I need to change in multiple places in the application. instead, I changed the react-apollo version as mentioned by @klaaz0r

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

No branches or pull requests

3 participants