Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1751

EdgeDB errors when using Rescript v12 on Deno with experimental web apis

$
0
0

I’m working on a project, a site that lets my friends vote on movies to watch on my plex server, and I am getting some odd errors. I’m not 100% sure which combo is causing them, but I wanted to raise it here in case something is compatible with something else. Stack:

  • Deno and Fresh, no issues from there so far. I do have to make sure I use Deno install so rescript deps are in node_modules
  • Rescript v12 via the @next tag
  • @rescript/webapi, latest version
  • rescript-edgedb, latest version

Something fidgety is going on, and I’m not sure where it’s coming from. Here’s an example error:

module InsertMovie = %edgeql(`
    # @name insertMovie
    insert Movie {
        title := <str>$title
    }
`)
You referred to the module db__edgeql, but we've found one called Db__edgeql instead.
Is the name's casing right?ReScript

The output from running deno run build:edgedb -- --watch looks fine.

// @sourceHash 90ae927fdc440d4fbef6d3721c860e99

module InsertMovie = {
  let queryText = `# @name insertMovie
      insert Movie {
          title := <str>$title
      }`
  
  @live  
  type args = {
    title: string,
  }
  
  type response = {
    id: string,
  }
  
  @live
  let query = (client: EdgeDB.Client.t, args: args): promise<result<response, EdgeDB.Error.errorFromOperation>> => {
    client->EdgeDB.QueryHelpers.singleRequired(queryText, ~args)
  }
  
  @live
  let transaction = (transaction: EdgeDB.Transaction.t, args: args): promise<result<response, EdgeDB.Error.errorFromOperation>> => {
    transaction->EdgeDB.TransactionHelpers.singleRequired(queryText, ~args)
  }
}

Viewing all articles
Browse latest Browse all 1751

Trending Articles