geldata / geldata/gel-python

Directly querying user defined function returning optional fails typecheck

Open
#958 0 comments 0 reactions 0 assignees View on GitHub
bug ORM
Dominant language
Python
Stars
415
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Given a schema:
```edgeql
function MaybeInt() -> optional int64 using (1);
```

Trying to query a call to the function:
```py
result = self.client.query(default.MaybeInt())
```

Fails typechecking with the error:
```
error: Argument 1 to "query" of "ReadOnlyExecutor" has incompatible type "type[int64] | None"; expected "QueryableObject[int] | type[QueryableType[int]]" [arg-type]
```

Note, the query correctly returns `[1]`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.