feat: Implement getApp graphQL query

This commit is contained in:
Faruk AYDIN
2021-10-09 13:31:44 +02:00
committed by Ali BARIN
parent 4dbbf37844
commit f36a5cb6d8
5 changed files with 59 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
import { GraphQLObjectType, GraphQLSchema, GraphQLString, GraphQLList } from 'graphql';
import { GraphQLObjectType, GraphQLSchema, GraphQLString, GraphQLList, GraphQLNonNull } from 'graphql';
import getApps from './queries/get-apps';
import getApp from './queries/get-app';
import appType from './types/app';
const queryType = new GraphQLObjectType({
name: 'Query',
@@ -10,7 +12,14 @@ const queryType = new GraphQLObjectType({
name: { type: GraphQLString }
},
resolve: (_, { name }) => getApps(name)
}
},
getApp: {
type: appType,
args: {
name: { type: GraphQLNonNull(GraphQLString) },
},
resolve: (_, { name }) => getApp(name)
},
}
});