Comments (7)
Yes it's correctly typed but typescript complains
from edgedb-js.
Thanks for the report! We've been iterating on these, so I'll make sure we have test coverage here once we get it fixed.
from edgedb-js.
Looks like this is a misalignment of canary versions of the driver (which defines the introspection queries) and the generate module. See if you can update to the latest canary on both the driver package (edgedb
) and the generator package (@edgedb/generate
) and get it working. I've added some tests in a separate PR that ensures we don't break this again in the future.
from edgedb-js.
This is working as intended since that query does not throw if it doesn't find an object with that ID, it returns null instead. If you want the query to fail with a database error you could wrap that query in an assert_exists
which will cause the query cardinality to be exactly one, which seems like the behavior you are expecting here.
from edgedb-js.
Oh actually the cardinality seems like it is wrong in your example, it should be using querySingle
. Are you sure the query you are testing is filtering on exclusive property like in your example code above?
from edgedb-js.
Oh actually the cardinality seems like it is wrong in your example, it should be using
querySingle
. Are you sure the query you are testing is filtering on exclusive property like in your example code above?
Yes, I had a complex query before but then I also tested with this simple one. it was working fine before I upgraded to canary from the latest version 0.4.1
from edgedb-js.
Is your TestReturns
type correctly typed as | null
? When I run this on master
, I get the following:
export type ExclusiveArgs = Readonly<{
"id": string;
}>;
export type ExclusiveReturns = {
"name": string;
"id": string;
"number_of_movies": number | null;
"secret_identity": string | null;
"height": string | null;
} | null;
export function exclusive(client: Executor, args: ExclusiveArgs): Promise<ExclusiveReturns> {
return client.query(`\
select Hero {*} filter .id = <uuid>$id;`, args);
}
Which is correct for the types, although it isn't using querySingle
(I'll look into that).
from edgedb-js.
Related Issues (20)
- Custom naming strategy HOT 4
- Typescript compilation error when `verbatimModuleSyntax` is enabled on generated interface.ts
- Add support for the `ext::ai` embeddings API
- `unknown` args generation is overly broad for required arguments HOT 7
- [generate] issues with prompting about .gitignore HOT 2
- Support changing Session within a Transaction HOT 3
- In auth helper libraries, cookies have a session expiration time instead of living as long as the token itself
- Can't get to UI signup HOT 2
- Uncaught ReferenceError: Buffer is not defined in Partykit (Cloudflare Worker) HOT 4
- expose codecs for custom datatypes HOT 1
- Refactor EdgeDBError.source to standard cause
- Unable to adopt example of complex with usage from docs HOT 2
- Is there a way of generating nanoids through the ESDL file? HOT 2
- Can't import e from ".../edgeql-js
- Improve the type inference performance of `e.op` HOT 2
- Remix/Vite/EdgeDB: When using edgeql-js with tsx, imported modules are not resolved correctly. HOT 2
- Empty `e.params` generate an invalid query HOT 1
- Cannot use `ext::ai::search` from the query builder
- TypeScript compilation errors if `noUnusedLocals`, `noUnusedParameters`, or `exactOptionalPropertyTypes` are enabled
- `@edgedb/generate` scripts not executing properly with `bun` version 1.1.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edgedb-js.