在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):feathers-plus/graphql开源软件地址(OpenSource Url):https://github.com/feathers-plus/graphql开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):@feathers-plus/graphql
A high performance GraphQL adapter for SQL and non-SQL databases. Configuring the adapterYou can configure Feathers services using the @feathers-plus/graphql adapter as shown in the docs. The adapter can be configured to use either
Press the appropriate ExamplesAs you can see, the adapter requires multiple working parts in order to configure the GraphQL instance properly. That's just how GraphQL is. @feathers-plus/cli-generate-example contains 10 working examples of using the GraphQL adapter. They all use the same database and test harness. You should refer to them while reading the docs. The examples are:
Resolver FunctionsGraphQL is a wrapper around resolver functions you have to provide. You'll be familiar with resolvers if you've used the fastJoin common hook, as fastJoin's design is based on GraphQL. You will find that you need to write lots of resolver functions for a non-trivial app. For some insight, look at this relatively simple example involving just 5 tables.
The above example uses normal Feathers service calls, without caching, without batching. You would see an approximate ten-fold performance improvement is you used Feathers service calls in conjunction with BatchLoaders. These types of resolver functions would be more complicated. Finally, you may consider resolver functions which produce raw SQL statements if you are using an SQL database with Sequelize or Knex. This may very well result in a performance improvement over BatchLoaders but you would have to use something like join-monster along with resolver functions. Generating Resolver Functions@feathers-plus/cli, a.k.a. cli+, was written to automatically generate the resolver functions for you. You can customize the resulting resolver code if necessary. The examples in @feathers-plus/cli-generate-example were all written with cli+ and you can use cli+ to modify them. REST and GraphQLREST and GraphQL are totally different. Each is dope if used for the right thing. FeathersJS, using cli+, now supports both REST and GraphQL architectural concepts and their query languages. LicenseCopyright (c) 2018 Licensed under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论