Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Field does not exist on enclosing type. When using most filters (some, etc) #222

Closed
luhagel opened this issue Sep 11, 2019 · 9 comments
Closed
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Milestone

Comments

@luhagel
Copy link

luhagel commented Sep 11, 2019

Kind of a continuation of #190
Currently, when trying to use .findMany in combination with nested some: {} selection causes photon to throw an Invalid Invocation error.

Reason: Error occurred during query validation & transformation:
[2] Query (object)
[2]   ↳ findManyEventGroup (field)
[2]     ↳ where (argument)
[2]       ↳ EventGroupWhereInput (object)
[2]         ↳ OR (field)
[2]           ↳ EventGroupWhereInput (object)
[2]             ↳ participants_some_id (field)
[2]               ↳ Field does not exist on enclosing type.
@pantharshit00 pantharshit00 added bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. labels Sep 13, 2019
@pantharshit00
Copy link
Contributor

pantharshit00 commented Sep 13, 2019

I can confirm this with both the latest stable version(prisma2@2.0.0-preview-11, binary version: 408c0c08746064a56c8ba7cb167bad49f1d2c2f7 ) and the latest alpha version(prisma2@2.0.0-alpha.184, binary version: 408c0c08746064a56c8ba7cb167bad49f1d2c2f7)

image

Reproduction: https://github.com/harshit-test-org/prisma-photon-222

@luhagel
Copy link
Author

luhagel commented Sep 20, 2019

Quick update, after playing around with Harshit's repro repo, I can confirm that this problem exists for pretty much all of the filter methods not already solved individually (notIn etc)

Could you take a look at all the current filters and make sure photon knows how to forward them to the query engine? Nik recently updated the nested write/read docs and used startsWith, which currently doesn't work either.

Confirmed not working:

  • some
  • every
  • none
  • beginsWith
  • endsWith
  • probably others I forgot to test

@luhagel luhagel changed the title Field does not exist on enclosing type. When using some Field does not exist on enclosing type. When using most filters (some, etc) Sep 21, 2019
@nikolasburk nikolasburk added the process/candidate Candidate for next Milestone. label Sep 27, 2019
@janpio janpio assigned timsuchanek and unassigned pantharshit00 Sep 27, 2019
@janpio janpio added this to the Preview 14 milestone Sep 27, 2019
@janpio janpio removed the process/candidate Candidate for next Milestone. label Sep 27, 2019
@janpio janpio modified the milestones: Preview 14, Preview 15 Oct 11, 2019
timsuchanek added a commit that referenced this issue Oct 15, 2019
@timsuchanek
Copy link
Contributor

Fixed in latest alpha.
You can try it out with npm i -g prisma2@alpha.

@iherger
Copy link

iherger commented Oct 19, 2019

@timsuchanek, this works for me locally (MacOS).

However, on dokku/Heroku, the same query (using some in the filter) fails with the following error:

2019-10-19T08:00:33.347278374Z app[web.1]: { GraphQLError: Error in Photon:
2019-10-19T08:00:33.347464799Z app[web.1]: Error: Reason: Error occurred during query validation & transformation:
2019-10-19T08:00:33.347550779Z app[web.1]: Query (object)
2019-10-19T08:00:33.347622041Z app[web.1]:   ↳ findManyEvent (field)
2019-10-19T08:00:33.347688905Z app[web.1]:     ↳ where (argument)
2019-10-19T08:00:33.347763185Z app[web.1]:       ↳ EventWhereInput (object)
2019-10-19T08:00:33.347815993Z app[web.1]:         ↳ AND (field)
2019-10-19T08:00:33.347882522Z app[web.1]:           ↳ EventWhereInput (object)
2019-10-19T08:00:33.347934923Z app[web.1]:             ↳ staff_some_user (field)
2019-10-19T08:00:33.347999918Z app[web.1]:               ↳ Field does not exist on enclosing type.

Photon debug output:

2019-10-19T07:59:54.801094560Z app[web.1]: 2019-10-19T07:59:54.800Z getos { version: 'OpenSSL 1.1.1  11 Sep 2018\n' }
2019-10-19T07:59:54.802022498Z app[web.1]: 2019-10-19T07:59:54.801Z getos { ls: '' }
2019-10-19T07:59:54.803170339Z app[web.1]: 2019-10-19T07:59:54.802Z getos { version: 'OpenSSL 1.1.1  11 Sep 2018\n' }
2019-10-19T07:59:54.803808484Z app[web.1]: 2019-10-19T07:59:54.803Z getos { ls: '' }
2019-10-19T07:59:54.808082251Z app[web.1]: 2019-10-19T07:59:54.807Z getos { platform: 'linux', libssl: '1.1.1' }
2019-10-19T07:59:54.808798941Z app[web.1]: 2019-10-19T07:59:54.808Z getos { platform: 'linux', libssl: '1.1.1' }

@pantharshit00
Copy link
Contributor

@iherger

Can you please make sure that you are using the latest version? I was unable to reproduce this

@iherger
Copy link

iherger commented Oct 30, 2019

@pantharshit00 , thanks for following up. It is actually working now, also on Heroku.

@kenule500
Copy link

am using 2.0.0-alpha.1217 but still not working for me

@pantharshit00
Copy link
Contributor

@kenule500 Please open a new issue with a minimal reproduction

@SteedMonteiro
Copy link

try to update @prisma/cli and @prisma/client to the same version. I had the issue and it fixed it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

8 participants