graphile / graphile/postgraphile-apollo-server
couldn't add schema extension plugin
- Dominant language
- JavaScript
- Stars
- 41
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
This source code works fine if I just changed the connection string to my Postgres db.
However, I would like to use Apollo federation with this. Trying to add my own schema extension plugin, like:
```js
const { makeExtendSchemaPlugin, gql } = require("graphile-utils");
const SchemaExtensionPlugin = makeExtendSchemaPlugin(build => {
// Get any helpers we need from `build`
const { pgSql: sql, inflection } = build;
return {
typeDefs: gql`
type NewType @key(fields: "id") {
id: Int!
name: String
stuff: ExistingType
}
extend type ExistingType @key(fields: "upc") {
upc: String! @external
}
`,
resolvers: { ... }
};
});
module.exports = SchemaExtensionPlugin;
```
But got error like:
```
node_modules\graphile-utils\node8plus\makePgSmartTagsPlugin.js:9
[graphile_build_pg_1.PgEntityKind.CLASS]: "for tables, composite
types, views and materialized views",
^
TypeError: Cannot read property 'CLASS' of undefined
at Object. (C:\Workspace\emcp-gql-federation\nodejs\pg-apollo-server\node_modules\graphile-utils\node8plus\makePgSmartTagsPlugin.js:9:39)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Workspace\emcp-gql-federation\nodejs\pg-apollo-server\node_modules\graphile-utils\node8plus\index.js:24:22)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
...
```
Is this supported here?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.