API

    fast api crud 만들기

    # create user = User( name="kim", age=1) db.add(user) db.commit() db.refresh(user) # read user_list = db.query(User) # update db_user = db.get(User, user.id) user_data = user.dict(exclude_unset=True) for key, value in user_data.items(): setattr(db_user, key, value) db.add(db_user) db.commit() db.refresh(db_user) # delete db.query(User).delete() db.commit()

    스프링 WebClient로 graphql 서버에 요청응답받기

    org.springframework.boot spring-boot-starter-webflux 3.0.2 com.graphql-java-kickstart graphql-webclient-spring-boot-starter 1.0.0 WebClient 가 webflux에 포함되어 있습니다. WebClient webClient = WebClient .builder() .baseUrl("https://apijosu.com/graphql") .defaultHeader("Authorization", "Bearer user token") .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .build(); WebClient로 get,..