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

Id type #2

Open
aymanbagabas opened this issue Aug 23, 2019 · 1 comment
Open

Id type #2

aymanbagabas opened this issue Aug 23, 2019 · 1 comment

Comments

@aymanbagabas
Copy link

aymanbagabas commented Aug 23, 2019

Hi,

Thanks for your great work.

I have an issue with IDs. We're using UUID in our Postgres DB and not Int. This causes a problem when fetching data from Postgraphile. Right now, ra-postgraphile-client uses hard-coded ID types (i.e Int) where parseId uses parseInt causes an UUID to be wrong.

Line 13 in build_query.js

My workaround is

  switch (raFetchType) {
    case 'GET_ONE':
      const idType = type.fields.find(t => t.name === "id").type.ofType.name
      return {
        query: gql`query ${resource[raFetchType].name}($id: ${idType}!) {
@des-des
Copy link
Owner

des-des commented Aug 30, 2019

Ah thanks @aymanbagabas I can push a fix on sunday!

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

2 participants