Graphback: An error is thrown if `plugins` is not defined in .graphqlrc.yml file

Created on 22 May 2020  路  8Comments  路  Source: aerogear/graphback

With 0.14.0-dev2, when plugins key is not defined in the configuration file, I am seeing an error

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)

I believe it is coming from here https://github.com/aerogear/graphback/blob/8fa8dcdebab081313fa9daf2fa21ea52d3311efe/packages/graphback/src/loadPlugins.ts#L6 since the pluginConfig is undefined.

bug

All 8 comments

https://github.com/aerogear/graphback/issues/1068

Yeah I have seen this before. To be completely honest I don't remember the exact reason that I closed it.

Why do you not have any plugin define? Isn't SchemaCRUDPlugin needed?

1068

Yeah I have seen this before. To be completely honest I don't remember the exact reason that I closed it.

Oh the issue is closed that's why it did not show up when I did a quick search.

So for me was when I did not have plugins setup that I was seeing this error.

Why do you not have any plugin define? Isn't SchemaCRUDPlugin needed?

I thought with stuffs being done at runtime, I could try to remove some plugins graphback-schema being one of them hence the error. Probably a user mistake and if so, we should at least have a better error message.

Runtime still uses plugins to transform schema:

https://github.com/aerogear/graphback/blob/83def270c729aa2e003996961640439742280495/packages/graphback/src/GraphbackRuntime.ts#L22

Probably a user mistake and if so, we should at least have a better error message.

Absolutely, we are going to move to a code-based plugin approach anyway (see https://github.com/aerogear/graphback/issues/1283) so this can be resolved there :)

So templates in graphback have examples. We still need plugins there. We just do not need to use cli to generate code anymore (unless client side queries)

Just ran into this issue.

Where are you seeing this?

I can see that the only places GraphbackGenerator is being used is in integration tests and the generate command.

I think client generation will be moved to Offix at some point, then we can remove GraphbackGenerator and this problem should go away.

But since it is probably a quick fix, if you are in that area feel free to action it :D

Yep. Same here. Quick fix needed.

Where are you seeing this?

https://github.com/aerogear/graphback/pull/1567#discussion_r445446494

But since it is probably a quick fix, if you are in that area feel free to action it :D

I'll create a separate PR

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itsemirhanengin picture itsemirhanengin  路  3Comments

ankitjena picture ankitjena  路  5Comments

wtrocki picture wtrocki  路  7Comments

ssd71 picture ssd71  路  4Comments

b1zzu picture b1zzu  路  4Comments