Skip to content

GraphQL

Execute GraphQL queries and mutations.

2 modules

ModuleDescription
GraphQL 변이엔드포인트에 GraphQL 변이 실행
GraphQL 쿼리엔드포인트에 GraphQL 쿼리 실행

Modules

GraphQL 변이

graphql.mutation

엔드포인트에 GraphQL 변이 실행

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-GraphQL 엔드포인트 URL
mutationstringYes-GraphQL 변이 문자열
variablesobjectNo-키-값 쌍으로 된 GraphQL 변이 변수
headersobjectNo-요청과 함께 보낼 추가 HTTP 헤더
auth_tokenstringNo-인증을 위한 Bearer 토큰 (Authorization 헤더로 추가됨)

Output:

FieldTypeDescription
dataobjectGraphQL 응답 데이터
errorsarrayGraphQL 오류 (오류가 없으면 null)
status_codenumberHTTP 상태 코드

Example: Create user mutation

yaml
url: https://api.example.com/graphql
mutation: mutation CreateUser($input: UserInput!) { createUser(input: $input) { id name } }
variables: {"input": {"name": "John", "email": "john@example.com"}}

GraphQL 쿼리

graphql.query

엔드포인트에 GraphQL 쿼리 실행

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-GraphQL 엔드포인트 URL
querystringYes-GraphQL 쿼리 문자열
variablesobjectNo-키-값 쌍으로 된 GraphQL 쿼리 변수
headersobjectNo-요청과 함께 보낼 추가 HTTP 헤더
auth_tokenstringNo-인증을 위한 Bearer 토큰 (Authorization 헤더로 추가됨)

Output:

FieldTypeDescription
dataobjectGraphQL 응답 데이터
errorsarrayGraphQL 오류 (오류가 없으면 null)
status_codenumberHTTP 상태 코드

Example: Simple query

yaml
url: https://api.example.com/graphql
query: { users { id name } }

Example: Query with variables and auth

yaml
url: https://api.example.com/graphql
query: query GetUser($id: ID!) { user(id: $id) { id name email } }
variables: {"id": "123"}
auth_token: my-token

Released under the Apache 2.0 License.