在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):confluentinc/ksqldb-graphql开源软件地址(OpenSource Url):https://github.com/confluentinc/ksqldb-graphql开源编程语言(OpenSource Language):TypeScript 88.2%开源软件介绍(OpenSource Introduction):ksqldb-graphqlGraphQL integration for ksqlDB to facilitate easier app creation by abstracting ksqlDB syntax and protocol. BackgroundKLIP-15 creates a new API with which to interact. This repository contains packages to generate graphQL as well as handle the ksqlDB protocol. Installation
IntegrationFor statements to be executed against ksqDB, RequestOptions must be provided, both at startup and in the context of the graphQL resolvers. The prebuild step, Usageimport { connect } from 'http2';
import { ApolloServer } from 'apollo-server';
import { generateGraphQL } from '@confluentinc/ksqldb-graphql';
import { addResolveFunctionsToSchema } from 'graphql-tools';
const session = connect(`http://localhost:8088`);
const options = {
hostname: 'localhost',
port: 8088,
};
generateGraphQL({ options }).then(
({ schemas, queryResolvers, subscriptionResolvers, mutationResolvers }) => {
const server = new ApolloServer({
context: async () => ({
ksqlDB: {
options,
session,
},
}),
schema: addResolveFunctionsToSchema({
schema: schemas,
resolvers: {
Subscription: subscriptionResolvers,
Query: queryResolvers,
Mutation: mutationResolvers,
}
}),
subscriptions: {
keepAlive: 1000,
},
});
server.listen();
}
); Packages@confluentinc/ksqldb-graphqlGenerates the schema and resolvers based on an existing ksqlDB cluster. @confluentinc/ksqldb-clientResolves the ksqlDB protocol and executes ksqlDB statements Rideshare |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论