hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.03k stars 2.76k forks source link

Clarify TypeScript Metadata SDK usage #6477

Open namoscato opened 3 years ago

namoscato commented 3 years ago

I'm having some trouble importing the Convert class from @hasura/metadata for at least a few reasons:

  1. The module name under Usage is incorrect (should be @hasura/metadata)
  2. package.json's main entry is invalid (should be v2/index.js)

I'm happy to make these changes but wanted to open an issue first to see if I was missing something.

namoscato commented 3 years ago

I think https://github.com/hasura/graphql-engine/pull/6478 partially fixes this issue, but v2/index.js also seems to be using invalid ES6 Module syntax, i.e.

./node_modules/@hasura/metadata/v2/index.js:1
export * from "../dist/HasuraMetadataV2"
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:979:16)