반응형

CRUD

create / read / update / delete

C : 생성
post메서드(axios rest-API)
mutation(apollo-client/graphql-API)
R : 조회
get메서드(axios rest-API)
query(apollo-client/graphql-API)
U : 수정
put메서드(axios rest-API)
mutation(apollo-client/graphql-API)
D : 삭제
delete(axios rest-API)
mutation(apollo-client/graphql-API)

Mutation과 Query차이

데이터베이스 안에서 무언가 조작하여 데이터 변형이 있는 경우
위험한 작업임을 알 수 있도록 메서드 명이 mutation 이다
몇번을 조회하더라도 데이터 변형이 없는 단순 작업은 query 메서드

axios apollo-client
import axios from ‘axios’ import {객채명 … } from ‘@apollo/client’
axios.post(api이름) useMutation(api이름)
axios.put/delete/get(api이름) useQuery(api이름)
특징 : 주는대로 데이터를 다받음 특징 : 데이터를 골라서 받는다

 

 

 

 

 

 

 


 

 

 김춘장이의 위키백과 - 나만의 공부 기록 Tistory 

 

gayulz - Overview

개발자가 되고싶은 개발어린이💟. gayulz has 11 repositories available. Follow their code on GitHub.

github.com


 

반응형
유리쯔의일상