Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

exp.39 (39みゅーじっく!)

Latest
Compare
Choose a tag to compare
@SaltyAom SaltyAom released this 08 Nov 12:54
· 32 commits to main since this release
28c4123

[39みゅーじっく!] is the 100th star release for KingWorld 🎉

This release doesn't have a big change for the code but has a big change for the community.

Nested Schema

.39 introduce better support for the nested schema.
Instead of inheriting the global schema first, KingWorld now handles the local schema first.

If a duplicated schema is found, KingWorld now infers type correctly instead of having infinite cycling.

Community Plugin: Controllers

Now we have another community plugin, Controllers is a plugin for defining decorator and controller-based routing.

import { Controller, Get, kwControllers } from 'kingworld-controllers'; 

// /users prefix
@Controller('/users/')
class UsersController {
  @Get()
  index() {
    return 'Hello World'
  }
}

const app = new KingWorld()

app.use(kwControllers, {
  controllers: [UsersController],
})

app.listen(3000);

GraphQL support with Yoga

Screenshot 2565-11-08 at 19 32 50

With @kingworldjs/graphql-yoga, you can now use GraphQL Yoga with KingWorld.

Change Log

Breaking Change:

  • method is changed to route

Improvement:

  • LocalHook now prefers the nearest type instead of the merge
  • Merge the nearest schema first
  • add contentType as a second parameter for BodyParser

Bug fix:

  • Correct type for after handle
  • Fix infinite cycling infer type for Handler