Skip to content

Error in the "Getting Started" sample code #1488

@P-147

Description

@P-147

Perceived Problem

Hi Graffle team! 👋

I'm new to your library, and wanted to test it quickly to see how it works.
So I tried to follow the "Getting Started" guide on your website, but I got an unexpected error when I tried to run the script described in this section : Send Your First Document

The error obtained:

node index.js 
file:///Users/pierre/graffle_test/node_modules/.pnpm/graffle@8.0.0-next.223_@effect+cluster@0.55.0_@effect+platform@0.93.8_effect@3.19.19__@_81ccbdf1d24019febd829fdf9b317ef7/node_modules/graffle/build/client/client.js:110
                        throw new Error(`Could not get operation type`);
                              ^

Error: Could not get operation type
    at file:///Users/pierre/graffle_test/node_modules/.pnpm/graffle@8.0.0-next.223_@effect+cluster@0.55.0_@effect+platform@0.93.8_effect@3.19.19__@_81ccbdf1d24019febd829fdf9b317ef7/node_modules/graffle/build/client/client.js:110:31
    at Proxy.<anonymous> (file:///Users/pierre/graffle_test/node_modules/.pnpm/graffle@8.0.0-next.223_@effect+cluster@0.55.0_@effect+platform@0.93.8_effect@3.19.19__@_81ccbdf1d24019febd829fdf9b317ef7/node_modules/graffle/build/client/methods/gql/DocumentSender.js:34:39)
    at file:///Users/pierre/graffle_test/index.js:21:4
    at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v22.16.0

(FYI: I'm using the lib with Javascript, installed with pnpm).

I was this close 🤏 to throw the towel, but decided to search through your repo for another example, just in case... And the noticed that the method to "send" the query was written as .$send(...), not .send(...) (missing the $).

After fixing it, it worked as expected and I was able to execute the query.

Ideas / Proposed Solution(s)

If it's indeed an error, you might want to fix this line here to update the guide

.send({ filter: [`Canada`, `Germany`, `Japan`] })

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions