SDKs overview

While GraphQL Jobs primarily functions as a job board for developers seeking GraphQL-related employment and for companies hiring GraphQL talent, it also exposes a public GraphQL API. This API allows developers to programmatically access job listings, company information, and other relevant data available on the platform. The availability of a GraphQL API means that direct SDKs in the traditional sense (pre-packaged client libraries for specific programming languages) are often less critical than general-purpose GraphQL client libraries. Developers typically interact with the GraphQL Jobs API using existing GraphQL client SDKs and libraries tailored to their chosen programming language, which handle tasks such as query construction, request execution, and response parsing. This approach leverages the standardized nature of GraphQL query language specifications to provide flexible integration options.

The core utility for developers lies in integrating job data into custom applications, dashboards, or automated job-seeking tools. This page outlines how developers can interact with the GraphQL Jobs API using common GraphQL client libraries and highlights any specific tools or community contributions that simplify this process. Understanding how to query a GraphQL endpoint is fundamental to utilizing the GraphQL Jobs data effectively, irrespective of the specific client library chosen. The API provides structured data, making it suitable for applications requiring filtered, real-time job information.

Official SDKs by language

GraphQL Jobs does not offer official, proprietary SDKs in the same way a SaaS product might. Instead, interaction with the platform's job data is facilitated through its public GraphQL API endpoint. This means developers utilize standard GraphQL client libraries available across various programming languages to build their integrations. These client libraries are maintained by the broader GraphQL community and are designed to work with any GraphQL API, including that of GraphQL Jobs. The table below lists commonly used GraphQL client libraries that can be employed to interact with the GraphQL Jobs API.

Language Common Client Package Installation Command (Example) Maturity
JavaScript/TypeScript Apollo Client npm install @apollo/client graphql Stable, widely used
JavaScript/TypeScript Relay npm install react-relay relay-compiler graphql Stable, Facebook-backed
Python Graphene pip install graphene Stable, feature-rich
Python sgqlc pip install sgqlc Stable, lightweight
Java graphql-java-client Add to pom.xml or build.gradle Stable
Ruby graphql-client gem install graphql-client Stable
PHP webonyx/graphql-php composer require webonyx/graphql-php Stable
Go graphql-go/graphql go get github.com/graphql-go/graphql Stable

These clients abstract away the HTTP request details, allowing developers to focus on writing GraphQL queries and mutations. For detailed usage of each client, refer to their respective documentation, such as the Apollo Client official documentation.

Installation

Installation for interacting with the GraphQL Jobs API involves setting up a GraphQL client library in your development environment. The specific steps depend on your chosen programming language and package manager. Below are common installation examples for JavaScript (using npm) and Python (using pip), representing typical approaches.

JavaScript/TypeScript (with Apollo Client)

To use Apollo Client in a JavaScript or TypeScript project, you'll need @apollo/client and graphql. This is common for web applications built with React, Vue, or Angular.

npm install @apollo/client graphql

or if you prefer Yarn:

yarn add @apollo/client graphql

Python (with sgqlc)

For Python projects, sgqlc is a lightweight client that simplifies GraphQL interactions.

pip install sgqlc

Ensure you have Python and pip installed on your system. For other languages, consult the specific client library's documentation for installation instructions, typically involving package managers like Maven/Gradle for Java, Bundler for Ruby, or Composer for PHP.

Quickstart example

This quickstart demonstrates how to fetch job listings from the GraphQL Jobs API using a common JavaScript client, Apollo Client. The example outlines setting up the client, defining a GraphQL query, and executing it to retrieve data. The public GraphQL Jobs API endpoint is https://api.graphql.jobs/.

JavaScript with Apollo Client (React Example)

First, ensure you have installed @apollo/client and graphql as described in the installation section.

import React from 'react';
import { ApolloClient, InMemoryCache, ApolloProvider, gql, useQuery } from '@apollo/client';

// Initialize Apollo Client
const client = new ApolloClient({
  uri: 'https://api.graphql.jobs/',
  cache: new InMemoryCache(),
});

// Define your GraphQL query
const GET_JOB_LISTINGS = gql`
  query GetJobListings {
    jobs {
      id
      title
      company {
        name
      }
      applyUrl
      description
      postedAt
    }
  }
`;

function JobList() {
  // Execute the query using useQuery hook
  const { loading, error, data } = useQuery(GET_JOB_LISTINGS);

  if (loading) return <p>Loading jobs...</p>;
  if (error) return <p>Error: {error.message}</p>;

  return (
    <div>
      <h1>GraphQL Jobs Listings</h1>
      <ul>
        {data.jobs.map((job) => (
          <li key={job.id}>
            <h2>{job.title}</h2>
            <p>Company: {job.company.name}</p>
            <p>Posted: {new Date(job.postedAt).toLocaleDateString()}</p>
            <div dangerouslySetInnerHTML={{ __html: job.description }} />
            <a href={job.applyUrl} target="_blank" rel="noopener noreferrer">Apply Now</a>
          </li>
        ))}
      </ul>
    </div>
  );
}

function App() {
  return (
    <ApolloProvider client={client}>
      <JobList />
    </ApolloProvider>
  );
}

export default App;

This example demonstrates how to:

  1. Initialize the ApolloClient with the GraphQL Jobs API endpoint.
  2. Define a GraphQL query using the gql tag to fetch job details.
  3. Use the useQuery hook within a React component to execute the query and manage loading and error states.
  4. Render the fetched job data dynamically.

For non-React environments or other languages, the core principles remain similar: configure your GraphQL client with the API endpoint, construct your query, execute it, and process the returned JSON data. For instance, in Python, you might use requests with sgqlc to perform an HTTP POST request with the GraphQL query as the payload, then parse the JSON response.

Python Example (using requests and sgqlc)

This example shows how to make a GraphQL query using Python with the requests library and sgqlc for query building.

import requests
from sgqlc.endpoint import Endpoint
from sgqlc.types import Type, Field, list_of

# Define GraphQL types (simplified for example)
class Company(Type):
    name = Field(str)

class Job(Type):
    id = Field(str)
    title = Field(str)
    company = Field(Company)
    applyUrl = Field(str)
    description = Field(str)
    postedAt = Field(str)

class Query(Type):
    jobs = Field(list_of(Job))

# GraphQL API endpoint
endpoint_url = 'https://api.graphql.jobs/'

# Initialize the endpoint
endpoint = Endpoint(endpoint_url)

# Define the query operation
query = Query()
query.jobs.id()
query.jobs.title()
query.jobs.company.name()
query.jobs.applyUrl()
query.jobs.description()
query.jobs.postedAt()

# Execute the query
data = endpoint(query)

# Process the results
if data and data.jobs:
    print("GraphQL Jobs Listings:")
    for job in data.jobs:
        print(f"\nTitle: {job.title}")
        print(f"Company: {job.company.name}")
        print(f"Apply URL: {job.applyUrl}")
        # Note: Description might contain HTML, handle accordingly
        print(f"Posted: {job.postedAt}")
else:
    print("No jobs found or an error occurred.")

This Python quickstart demonstrates:

  1. Defining a simplified schema to guide sgqlc in constructing the query.
  2. Creating an Endpoint instance pointing to the GraphQL Jobs API.
  3. Building a query object by selecting desired fields.
  4. Executing the query and printing the results.

Developers should refer to the GraphQL Jobs API documentation for the full schema and available queries/mutations to customize their data retrieval.

Community libraries

Given that GraphQL Jobs provides a standard GraphQL API, the concept of "community libraries" primarily refers to the vast ecosystem of general-purpose GraphQL client libraries rather than specific wrappers built exclusively for GraphQL Jobs. Many developers contribute to and maintain these clients, ensuring broad language support and feature sets. Examples include:

  • GraphQL Request (JavaScript): A lightweight universal GraphQL client that works in Node.js and browsers. It's often preferred for simple scripts or server-side applications where a full-featured client like Apollo isn't necessary.
  • urql (JavaScript): A highly customizable and extensible GraphQL client, often used in React applications as an alternative to Apollo Client. It emphasizes performance and flexibility.
  • GraphiQL/GraphQL Playground: While not client libraries for integration, these are essential community-driven tools for exploring and testing GraphQL APIs directly in the browser. GraphQL Jobs's API is explorable via GraphiQL interface, which is invaluable for understanding the schema and crafting queries before implementing them in code.
  • Postman/Insomnia: API development environments that include robust support for GraphQL, allowing developers to construct and send GraphQL queries and inspect responses without writing code. These tools are widely used for initial API exploration and debugging.

The strength of the GraphQL ecosystem means that developers are not locked into proprietary SDKs but can choose from a wide array of mature, community-supported tools that fit their project's specific needs and technology stack. The official GraphQL website provides an extensive list of client libraries and tools across various programming languages, which are all applicable for interacting with the GraphQL Jobs API.