Add channels to shop-api - Help needed #1449
-
Hi :) In my multi-tenant solution, I would like to extend the shop API with the "channels" query from the admin-api. I would assume the resolver would be something like:
And the plugin:
But what should the service be?
Thank you a lot in advance for any help given. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @AndersGerner, If you are using the built-in schema: gql`
extend type Query {
- channels(): [Channel!]!
+ channels: [Channel!]!
}`, because the query does not take any arguments, so the presence of parentheses would cause a syntax error. |
Beta Was this translation helpful? Give feedback.
Hi @AndersGerner,
If you are using the built-in
ChannelService
from@vendure/core
, you don't need to implement your own service - it is already implemented. The plugin & resolver files alone should suffice. One fix you need to make is to remove the parentheses in your schema extension:because the query does not take any arguments, so the presence of parentheses would cause a syntax error.