NowGraphQLService interface - Android

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 1분
  • The NowGraphQLService interface provides functions that allow you to make GraphQL requests to your ServiceNow through its GraphQL API.

    주:
    The GraphQL API works for guest users in the base ServiceNow system.

    For more details on the ServiceNow GraphQL API, see Query record data using the GraphQL API framework.

    표 1. Properties
    Name Type Description
    configuration NowServiceConfiguration Configuration to associate with the service.

    NowGraphQLService - graphQLRequest(String query)

    Passes the specified GraphQL query to the associated ServiceNow instance and returns the query results.

    표 2. Parameters
    Name Type Description
    query String GraphQL query to pass.
    표 3. Returns
    Type Description
    Call<Byte Array> Query response.

    fun makeGraphQLRequest(query: String) { 
      val call = graphQLService.graphQLRequest(query) 
      call.enqueue( 
        { response -> handleResponse(response) },
        { nowDataError -> handleError(nowDataError) } 
      )
    }