diff --git a/client/src/graphql/gql/allModules.gql b/client/src/graphql/gql/allModules.gql index b572a7b2..c4b548de 100644 --- a/client/src/graphql/gql/allModules.gql +++ b/client/src/graphql/gql/allModules.gql @@ -1,12 +1,9 @@ +#import "./fragments/moduleParts.gql" query ModulesQuery { modules { edges { node { - id - title - metaTitle - teaser - slug + ...ModuleParts } } } diff --git a/client/src/graphql/gql/fragments/moduleParts.gql b/client/src/graphql/gql/fragments/moduleParts.gql new file mode 100644 index 00000000..6dbb929e --- /dev/null +++ b/client/src/graphql/gql/fragments/moduleParts.gql @@ -0,0 +1,7 @@ +fragment ModuleParts on ModuleNode { + id + title + metaTitle + teaser + slug +} diff --git a/client/src/graphql/gql/topicQuery.gql b/client/src/graphql/gql/topicQuery.gql new file mode 100644 index 00000000..38a3a931 --- /dev/null +++ b/client/src/graphql/gql/topicQuery.gql @@ -0,0 +1,16 @@ +#import "./fragments/moduleParts.gql" +query Topic($slug: String!){ + topic(slug: $slug) { + id + title + teaser + description + modules { + edges { + node { + ...ModuleParts + } + } + } + } +} diff --git a/client/src/pages/topic.vue b/client/src/pages/topic.vue index a2281643..fee429e4 100644 --- a/client/src/pages/topic.vue +++ b/client/src/pages/topic.vue @@ -1,11 +1,8 @@