-
|
Hello, I have a schema where four distinct types A, B, C, D inherit from the same abstract type X. Now, I have a query of the form: But I would like to filter out objects of class D, such that: What is the correct way to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
OK, that's rubber duck debugging at its best. Upon hitting "send", I immediately thought of: which works. However, the following seems to be unsupported (I get the error What is the correct way to achieve what I want then? |
Beta Was this translation helpful? Give feedback.
-
|
Update: This method from @elprans is better than the one I suggested:
Try this: assuming the types |
Beta Was this translation helpful? Give feedback.
-
|
This works, thanks a lot!
I suppose the following syntax would be nice:
```
select X {
field1,
field2
} filter . is (A|B|C)
```
Assuming that . is indeed a shorthand for the object itself.
Thanks a lot for your help.
Greg
… On 12 Apr 2023, at 15:11, Devon Campbell ***@***.***> wrote:
Try this:
select X {
field1,
field2
} filter .__type__.name = 'default::A'
or .__type__.name = 'default::B'
or .__type__.name = 'default::C';
assuming the types A, B, and C are all in the default module.
—
Reply to this email directly, view it on GitHub <#5333 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AALX5MBK6ATQMIKDCLMYR3LXA2SXNANCNFSM6AAAAAAW3VAFPI>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
|
Actually, based on @elprans's reply above, the correct way to achieve this is: The following also works: Thanks all! |
Beta Was this translation helpful? Give feedback.
Actually, based on @elprans's reply above, the correct way to achieve this is:
The following also works:
Thanks all!