Escape-Technologies / graphman

Quikly scaffold a postman collection for a GraphQL API. Compatible with Postman & Insomnia.
MIT License
242 stars 12 forks source link

Unions not yet supported? #44

Closed acomito closed 1 year ago

acomito commented 1 year ago

Getting an error

error: Uncaught (in promise) Error: Kind UNION for type WorkItem is not supported yet. Please open an issue.

Is this a known limitation at the moment or maybe I have something configured incorrectly?

nohehf commented 1 year ago

No, it's a known limitation, I had no APIs to test it. Could you give more details (endpoint if it's public, expected output, etc ?)

EDIT: I believe that the output of a type (A | B) should be treated as:

nohehf commented 1 year ago

Update: I'll open a PR for supporting more types ASAP, including #47 (INTERFACE)

noraj commented 1 year ago
$ deno run https://deno.land/x/graphman@v1.1.3/src/cli.ts http://noraj.test:5013/graphql
Creating the postman collection for http://noraj.test:5013/graphql
✅ Granted net access to "noraj.test:5013".
error: Uncaught (in promise) Error: Kind UNION for type SearchResult is not supported yet. Please open an issue.
    throw new Error(
          ^
    at parseType (https://deno.land/x/graphman@v1.1.3/src/outrospector.ts:79:11)
    at https://deno.land/x/graphman@v1.1.3/src/outrospector.ts:166:20
    at Array.forEach (<anonymous>)
    at parseQueryOrMutationType (https://deno.land/x/graphman@v1.1.3/src/outrospector.ts:160:33)
    at outrospect (https://deno.land/x/graphman@v1.1.3/src/outrospector.ts:188:18)
    at createPostmanCollection (https://deno.land/x/graphman@v1.1.3/src/index.ts:13:25)
    at async https://deno.land/x/graphman@v1.1.3/src/cli.ts:41:20

The endpoint is a DVGA instance.