확장 기능

Internal GraphQL Server

PHP 코드를 사용하여 애플리케이션 내부에서 직접 GraphQL 쿼리를 실행합니다.

Logo
Target Image

이 확장 기능은 내부 GraphQL 서버를 설치합니다. 이 서버는 PHP 코드를 사용하여 애플리케이션 내부에서 호출할 수 있습니다.

내부 GraphQL 서버는 클래스 GatoGraphQL\InternalGraphQLServer\GraphQLServer를 통해 다음 세 가지 메서드로 접근합니다:

  • executeQuery: GraphQL 쿼리를 실행합니다
  • executeQueryInFile: (.gql) 파일에 포함된 GraphQL 쿼리를 실행합니다
  • executePersistedQuery: 저장된 GraphQL 쿼리를 실행합니다(ID를 정수로, 또는 슬러그를 문자열로 지정)(Persisted Queries 확장 기능이 필요합니다)

메서드 시그니처는 다음과 같습니다:

namespace GatoGraphQL\InternalGraphQLServer;
 
use PoP\Root\HttpFoundation\Response;
 
class GraphQLServer {
  /**
   * Execute a GraphQL query
   */
  public static function executeQuery(
    string $query,
    array $variables = [],
    ?string $operationName = null,
    int|string|null $schemaConfigurationIDOrSlug = null,
  ): Response {
    // ...
  }
 
 
  /**
   * Execute a GraphQL query contained in a (`.gql`) file
   */
  public static function executeQueryInFile(
    string $file,
    array $variables = [],
    ?string $operationName = null,
    int|string|null $schemaConfigurationIDOrSlug = null,
  ): Response {
    // ...
  }
 
 
  /**
   * Execute a persisted GraphQL query (providing its object
   * of type WP_Post, ID as an int, or slug as a string)
   */
  public static function executePersistedQuery(
    WP_Post|string|int $persistedQuery,
    array $variables = [],
    ?string $operationName = null
  ): Response {
    // ...
  }
}

GraphQL 쿼리를 실행하고 응답 내용을 가져오려면:

use GatoGraphQL\InternalGraphQLServer\GraphQLServer;
 
// Provide the GraphQL query
$query = "{ ... }";
 
// Execute the query against the internal server
$response = GraphQLServer::executeQuery($query);
 
// Get the content and decode it
$responseContent = json_decode($response->getContent(), true);
 
// Access the data and errors from the response
$responseData = $responseContent["data"] ?? [];
$responseErrors = $responseContent["errors"] ?? [];

All-Inclusive 번들 구매

Personal
$79
/
“All-Inclusive” 번들
라이선스 대상 1 도메인
구매 ->
  • 1 도메인
  • 지원
  • 제품 업데이트
Organization
$99
/
“All-Inclusive” 번들
라이선스 대상 3 도메인
구매 ->
  • 3 도메인
  • 지원
  • 제품 업데이트
Professional
$199
/
“All-Inclusive” 번들
라이선스 대상 10 도메인
구매 ->
  • 10 도메인
  • 지원
  • 제품 업데이트

라이선스는 1년간 유효합니다 (매년 갱신 가능). 가격은 USD 기준입니다.

더 많은 도메인이 필요하신가요? 문의하기

30일 환불 보장

각 확장 기능은 환불 신청 보장과 함께 구매하실 수 있습니다

Features illustration
Money back guarantee

환불 정책을(를) 읽어보세요

Testimonial image

“이 플러그인은 완전히 다른 차원입니다! 사이트를 전혀 새로운 수준으로 끌어올려 강력한 파워하우스로 변모시켜 줍니다. 할 수 있는 것들을 탐색하면 할수록 감동이 깊어집니다. 망설이고 있다면 지금 바로 구매하세요. 나중에 후회하게 될 겁니다. 문서는 그 자체만으로도 설명이 되고, 이보다 더 충실할 수 없을 정도입니다. Leo(개발자)는 제가 만나본 중에서 가장 날카롭고 기민한 개발자 중 한 명입니다. 응답이 매우 빠르고 자신의 전문 분야를 완벽하게 파악하고 있다는 것이 느껴집니다. 이 플러그인이 이토록 많은 것을 할 수 있다는 것에 진심으로 흥분됩니다. 가능성은 사실상 무한하며, SEO를 중요시한다면 이 플러그인이 사이트 순위를 크게 높여줄 것입니다.”

olmate - 웹 개발자

뉴스레터 구독하기

Gato GraphQL의 모든 업데이트를 놓치지 마세요.