Code Guy
Code Guy

Reputation: 3198

How to Search for Jobs with Multiple Skills in Upwork GraphQL API

I'm working with the Upwork GraphQL API and trying to perform a search for job postings that match multiple skills. Unfortunately, it seems that the current API implementation doesn't support querying for multiple skills at once using the skillExpression_eq filter.

Issue Description

I need to retrieve job postings that match either "Google Sheets" or "Google Apps Script". However, when using the skillExpression_eq filter, it appears that I can only specify a single skill.

Here is the query I attempted to use:

query marketplaceJobPostingsSearch(
  $marketPlaceJobFilter: MarketplaceJobPostingsSearchFilter,
  $searchType: MarketplaceJobPostingSearchType,
  $sortAttributes: [MarketplaceJobPostingSearchSortAttribute]
) {
  marketplaceJobPostingsSearch(
    marketPlaceJobFilter: $marketPlaceJobFilter,
    searchType: $searchType,
    sortAttributes: $sortAttributes
  ) {
    totalCount
    edges {
      node {
        id
        title
        createdDateTime
        description
      }
    }
  }
}

And the variables:

{
  "marketPlaceJobFilter": {
    "skillExpression_eq": "Google Sheets OR Google Apps Script"
  },
  "searchType": "JOBS_FEED",
  "sortAttributes": [
    { "field": "RECENCY" }
  ]
}

Problem

The above query returns no results. It seems the skillExpression_eq field does not support multiple skills with logical operators like OR.

Request for Assistance

Is there a way to perform a search that includes multiple skills in a single query? If the functionality is not currently supported, are there alternative methods or workarounds available? I would appreciate any guidance or suggestions on how to achieve this kind of search using the Upwork GraphQL API.

Upvotes: 0

Views: 225

Answers (1)

Bilal
Bilal

Reputation: 1

use titleExpression_eq instead of skillExpression_eq in marketPlaceJobFilter variable.

Here is the query I used:

{
  "query": "query marketplaceJobPostingsSearch($marketPlaceJobFilter: MarketplaceJobPostingsSearchFilter, $searchType: MarketplaceJobPostingSearchType, $sortAttributes: [MarketplaceJobPostingSearchSortAttribute]) { marketplaceJobPostingsSearch(marketPlaceJobFilter: $marketPlaceJobFilter, searchType: $searchType, sortAttributes: $sortAttributes) { totalCount edges { node { id title description category } } pageInfo { hasNextPage endCursor } } }",
  "variables": {
    "marketPlaceJobFilter": {
      "titleExpression_eq": "Google Sheets OR Google Apps Script"
    },
    "searchType": "USER_JOBS_SEARCH",
    "sortAttributes": [
      { "field": "RECENCY" }
    ]
  }
}

Upvotes: 0

Related Questions