@commitspark/graphql-api
Version:
GraphQL API to store and manage structured data with Git
13 lines (11 loc) • 388 B
text/typescript
import { getTypeById } from '../../../persistence/persistence'
import { GraphQLFieldResolver } from 'graphql'
import { ApolloContext } from '../../../client'
export const queryTypeByIdResolver: GraphQLFieldResolver<
any,
ApolloContext,
any,
Promise<string>
> = async (source, args, context, info) => {
return getTypeById(context.gitAdapter, context.getCurrentRef(), args.id)
}