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

Constraint error when using "upsertKyc" mutation #82

Closed
SkyLeite opened this issue Sep 15, 2020 · 3 comments · Fixed by #88
Closed

Constraint error when using "upsertKyc" mutation #82

SkyLeite opened this issue Sep 15, 2020 · 3 comments · Fixed by #88
Assignees
Labels
🐞 bug Something isn't working 👶 good first issue Good for newcomers

Comments

@SkyLeite
Copy link
Contributor

Error:

constraint error when attempting to insert struct: * kyc_data_account_id_fkey (foreign_key_constraint)If you would like to stop this constraint violation from raising anexception and instead add it as an error to your changeset, pleasecall foreign_key_constraint/3 on your changeset with the constraint:name as an option.The changeset has not defined any constraint.

Query:

{"query":"mutation {\n upsertKyc2069213328: upsertKyc(input: {accountId: "rodrigoky14", countryId: "1", document: "1231231231", documentType: "nite", phone: "11948340013", userType: "natural"}) {\n __typename0: __typename\n }\n}"}

@SkyLeite SkyLeite added the 🐞 bug Something isn't working label Sep 15, 2020
@amiskov
Copy link
Contributor

amiskov commented Sep 15, 2020

This query works for me in the current master branch:

mutation {
  upsertKyc(input: {accountId: "andreymiskov", countryId: "1", document: "1231231231", documentType: "nite", phone: "11948340013", userType: "natural"}) {
    phone
    country {
      name
    }
  }
}

I only changed accountId here. Is there any chance that we are using different versions of the backend? Maybe the issue is related to changing :string to :id for address fields?

@SkyLeite
Copy link
Contributor Author

I did some more research and this seems to happen when trying to submit an address for a user that doesn't yet exist. We shouldn't ever hit this path, but it would be cool to have a proper error message nonetheless :)

@lucca65
Copy link
Member

lucca65 commented Sep 23, 2020

@victorgdev can you help us on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 👶 good first issue Good for newcomers
Projects
None yet
4 participants