https://i.redd.it/k93h67yx2j231.pngHi everyone!The new version of FoalTS is out! FoalTS is a Node.Js framework written in TypeScript which provides a larget set of tools and components to build Web Apps & APIs. It also has extensive documentation.In this new release, Foal comes up with the support of GraphQL. Its components are compatible with the major GraphQL clients available on npm (graphql-request, Apollo client, etc). And the framework offers many other features to integrate GraphQL in your backend: type loading from separate files, error-handling or dependency injection.Let’s take a closer look!Basic Usageapp.controller.ts (the entry point of any Foal application)api.controller.tsAn example of what might look like the code in the frontendUsing separate files for Type Definitionsapi.controller.tsquery.graphqlDependency Injectionapi.controller.tsroot-resolver.service.tsError Handlingroot-resolver.service.ts (in production the details of any error thrown or rejected in the resolver are not returned to the client)https://i.redd.it/wukbat4c3j231.pngThe documentation can be found here: https://foalts.gitbook.io/docs/topic-guides/api/graphqlIf you have any feedback, feel free to leave a comment!Loïc
Submitted June 05, 2019 at 01:08PM by Loic_Poullain
No comments:
Post a Comment