How to connect my gRPC server written in java with graphQL server
I have a simple graphQL server
import { ApolloServer } from "@apollo/server";
import { startStandaloneServer } from "@apollo/server/standalone";
const typeDefs = `#graphql
type Task {
id: String
name: String
completed: Boolean
}
type Query {
tasks: [Task]
}
`;
const tasks = [
{ id: "todo-1", name: "Eat", completed: true },
{ id: "todo-2", name: "Sleep", completed: false },
{ id: "todo-3", name: "Repeat", completed: false },
];
const resolvers = {
Query: {
tasks: () => tasks,
},
};
const server = new ApolloServer({
typeDefs,
resolvers,
});
const { url } = await startStandaloneServer(server, {
listen: { port: 4002 },
});
console.log(`
精彩评论