Enable graphql filtering
This commit is contained in:
parent
148756d786
commit
3560c2cae8
|
@ -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), {}),
|
||||
})
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Query } from 'react-apollo'
|
|||
|
||||
const getAlbumsQuery = gql`
|
||||
query getMyAlbums {
|
||||
myAlbums {
|
||||
myAlbums(filter: { parentAlbum: null }) {
|
||||
id
|
||||
title
|
||||
photos {
|
||||
|
|
Loading…
Reference in New Issue