diff --git a/api/src/index.js b/api/src/index.js index 8934cf70..af3fd1b2 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -50,10 +50,10 @@ const schema = makeAugmentedSchema({ hasRole: true, }, mutation: false, - query: false, - // query: { - // exclude: ['ScannerResult', 'AuthorizeResult', 'Subscription'], - // }, + query: true, + query: { + exclude: ['ScannerResult', 'AuthorizeResult', 'Subscription', 'PhotoURL'], + }, }, resolvers: resolvers.reduce((prev, curr) => _.merge(prev, curr), {}), }) diff --git a/api/src/schema.graphql b/api/src/schema.graphql index a7495cb5..526081cc 100644 --- a/api/src/schema.graphql +++ b/api/src/schema.graphql @@ -3,7 +3,7 @@ enum Role { User } -type User @isAuthenticated { +type User @hasRole(roles: [Admin]) { id: ID! username: String! albums: [Album] @relation(name: "OWNS", direction: "OUT") @@ -12,7 +12,7 @@ type User @isAuthenticated { admin: Boolean } -type Album { +type Album @hasRole(roles: [Admin]) { id: ID! title: String photos: [Photo] @relation(name: "CONTAINS", direction: "OUT") @@ -31,7 +31,7 @@ type PhotoURL { height: Int } -type Photo { +type Photo @hasRole(roles: [Admin]) { id: ID! title: String # Local filepath for the photo diff --git a/ui/src/Pages/AllAlbumsPage/AlbumsPage.js b/ui/src/Pages/AllAlbumsPage/AlbumsPage.js index 5ae06af5..62f407c7 100644 --- a/ui/src/Pages/AllAlbumsPage/AlbumsPage.js +++ b/ui/src/Pages/AllAlbumsPage/AlbumsPage.js @@ -6,7 +6,7 @@ import { Query } from 'react-apollo' const getAlbumsQuery = gql` query getMyAlbums { - myAlbums { + myAlbums(filter: { parentAlbum: null }) { id title photos {