ai,

AI Developer in FIRE Journey

Cui Cui Follow Aug 19, 2023 · 1 min read
AI Developer in FIRE Journey
Share this

“FIRE: Financial Independence, Retire Early.”

API for FIRE

Start with a simple API for FIRE, by using Kotlin and Spring Boot.

Spring for GraphQL

  1. Setup project. start.spring.io

    • Gradle-Kotlin
    • Kotlin
    • Java 17
    • Spring Web
    • Spring GraphQL
  2. Add GraphQL Schema CodeGen Netflix DGS Codegen

         plugins {
             id("com.netflix.dgs.codegen") version "6.0.2"
         }
    
         tasks.generateJava {
             language = "kotlin"
             schemaPaths = mutableListOf("${projectDir}/src/main/resources/graphql")
             packageName = "com.cuizhanming.template.kotlin.codegen"
         }
    
  3. Add GraphQL Schema, under schemaPath configured as above step /src/main/resources/graphql

         type TaxCredit {
             id: ID!
             name: String!
             year: Int!
             amount: Float!
             type: String!
             issuedAt: String!
             createdAt: String!
             updatedAt: String!
         }
    
         type Query {
             availableCredits(year: String): [TaxCredit]
         }
    

Knowledge Graph

GraphQL frameworks

Class Diagram

Join Newsletter
Get the latest news right in your inbox. We never spam!
Cui
Written by Cui Follow
Hi, I am Z, the coder for cuizhanming.com!