티스토리 뷰
1. packagist.org/packages/nuwave/lighthouse
nuwave/lighthouse - Packagist
README Lighthouse A framework for serving GraphQL from Laravel Lighthouse is a GraphQL framework that integrates with your Laravel application. It takes the best ideas of both and combines them to solve common tasks with ease and offer flexibility when you
packagist.org
- composer require nuwave/lighthouse
- php artisan vendor:publish --tag=lighthouse-schema : graphql/schema.graphql 생성
- php artisan vendor:publish --tag=lighthouse-config : config/lighthouse.php 생성
- config/cors.php
return [
- 'paths' => ['api/*', 'sanctum/csrf-cookie'],
+ 'paths' => ['api/*', 'graphql', 'sanctum/csrf-cookie'],
...
];
이러면 깔고 설치 된거임. ㅇㅇ
서버 실행하고,...... 아 기본적으로 user 테이블은 마이그레이션 되어있어야 하는 상황임.
포스트맨에서 127.0.0.1/graphql 로 접속 주소 주고,
헤더에 Accept : application/json 추가해주고
바디에 GraphQL 선택한 담에 쿼리를 입력해보자.
{
user (id: 1) {
name
email
}
}
post로 전송하면 결과가 쨘! 하고 나올것이당

담번엔 crud하게되면 이어서 쓰게씀!
'Laravel' 카테고리의 다른 글
| laravel 8] spatie/permission 테스트 코드 (0) | 2021.06.27 |
|---|---|
| 도커(라라독) 사용하기! (1) | 2021.06.27 |
| Syntax error or access violation: 1071 Specified key was too long; (0) | 2020.09.10 |
| 라라벨7.0 생텀 spa (1) | 2020.09.07 |
| 검색시 공백 오류 (0) | 2020.07.15 |
- Total
- Today
- Yesterday
- UTF8
- fmf
- xml로도
- PhpStorm
- twoseven.kr/0410
- gcp
- 배열을_이쁘게
- twoserven.kr/0410
- 프로그래밍은디버거부터시작이다
- 테스팅환경
- 더미데이터도유형이있어요
- 엘라스틱서치한글성공!
- 테스팅
- JSON으로도
- Testing
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |