Authenticate with test environments for Salesforce and Stripe

Aug 4th, 2021

Salesforce and Stripe both offer "test" authentication flows. These are separate environments with their own data that you can use while developing your integration.

OneGraph now has built-in support for authenticating with these test flows. You'll see new Salesforce [test] and Stripe [test] options in the Authentication dropdown in GraphiQL. They're also available when you create server-side tokens from the Server-Side Auth page.

If you're using onegraph-auth, our npm package, pass true as the third argument to login, e.g. auth.login('stripe', null, true), to log your users in with the test flow.

If you're manually constructing authentication URLs, add test=true as a query param to the /oauth/start url.

API metrics with rate limit info

Aug 4th, 2021

There is new data in the extensions field that shows you aggregate information about the API requests OneGraph made to fulfill your GraphQL query.

We surface information about API rate limits for the services that provide it. If you've worked with the Salesforce API and Salesforce admins who are constantly fighting to keep under their API quota, then you know how valuable this is.

{
  "data": "...",
  "extensions": {
    "metrics": {
      "api": {
        "avoidedRequestCount": 0,
        "requestCount": 1,
        "totalRequestMs": 457,
        "byHost": [
          {
            "host": "na173.salesforce.com",
            "requestCount": 1,
            "totalRequestMs": 457,
            "rateLimit": {
              "limit": 15000,
              "remaining": null,
              "used": 1,
              "resetAt": null
            }
          }
        ]
      }
    }
  }
}

You can turn it off by adding show_metrics=false as a query param to your URL.

Much of this information is also available with our Honeycomb integration.

Salesforce GraphQL Subscriptions package updated to support Contacts

Jul 29th, 2021

Our Salesforce package has been updated to support contacts.

Go grab our free OneGraph GraphQL Subscriptions package on the AppExchange store.

We support subscriptions to common Salesforce sobjects through the package and can support any sobject through a supplemental package. Contact sayhi@onegraph.com to get started.

Read more about Salesforce subscriptions and subscriptions on OneGraph in the docs.

Always-online persisted queries

Jul 23rd, 2021

There is a new "Fallback on error" option when you create a persisted query. Use it to keep your queries online even when the underlying API is down or you hit a rate-limit.

To use it, you also need to add caching to the query.

You can create a persisted query from the Persisted Queries section of the OneGraph dashboard, or with a mutation:

mutation PersistQuery($query: String!, $appId: String!) {
  oneGraph {
    createPersistedQuery(
      input: {
        query: $query
        appId: $appId
        cacheStrategy: { timeToLiveSeconds: 600 }
        fallbackOnError: true
      }
    ) {
      persistedQuery {
        id
      }
    }
  }
}

Read more about persisted queries in the docs.

Send Subscription Delivery metrics to Honeycomb

Jun 27th, 2021

In addition to sending metrics for every API call OneGraph makes on your behalf, the Monitoring tab on the dashboard now supports sending subscription delivery metrics to Honeycomb.

Each event includes the following keys:

KeyTypedescription
destinationStringThe url of the webhook destination, or websocket
subscriptionIdStringThe id of the subscription
operationNameStringThe optional operationName of the subscription, e.g. GitHubRepoSubscription
statusCodeIntegerThe status code OneGraph received from your server, if it received a status code
webhookRequestMillisecondsIntegerThe time, in milliseconds, it took us to send the webhook POST request to the server
timedOutBooleantrue if the request timed out before we finished sending the webhook
truncatedResponseBodyStringThe first 512 bytes of the response from the server, if OneGraph did not receive a 2xx or a 410 status code

Send API metrics to Honeycomb

Jun 24th, 2021

There is a new page on the OneGraph dashboard dedicated to monitoring.

Our first monitoring feature will send metrics from the OneGraph service directly to your Honeycomb project.

Once configured, OneGraph will send an event to Honeycomb for each API call made while executing one of your GraphQL queries. The event will contain the following keys:

KeyTypeDescription
hostStringThe host, e.g. api.github.com
statusCodeIntegerThe HTTP status code, e.g. 200
methodStringThe HTTP method, e.g. GET

Monitoring page

Support for the updated sobjects API in Salesforce

Oct 16th, 2020

Use the new updatedSobjects field to keep track of the latest updates to your Salesforce data. Salesforce allows you to make requests for a range within the last 30 days.

The example below gets the last two leads that were updated or created this month:

query UpdatedLeadsQuery {
  salesforce {
    updatedSobjects(
      start: "2020-10-01T00:00:00+00:00"
      end: "2020-10-16T00:00:00+00:00"      
    ) {
      leads(last: 2) {
        latestDateCovered
        ids
        nodes {
          id
          name
          createdDate
        }
      }
    }
  }
}

Keep the Salesforce rate-limits in mind when you use this new field. The query will only use up one of your API calls if you only request the ids field. If you only request top-level fields for the objects through the nodes field (e.g. node.name), OneGraph will make one additional API request for every 500 objects. If you request nested fields (e.g. node.account.name), OneGraph will use up at least one API request per node.

Up to 600,000 nodes could be returned in a single query, so it's best to use the first or last arg to limit the number of API requests.

OneGraph also supports GraphQL subscriptions for Salesforce. Learn more about subscriptions in the docs.

PKCE extension for OAuth in OneGraphAuth

Sep 24th, 2020

OneGraphAuth now uses the PKCE extension for OAuth by default.

Upgrade to onegraph-auth@3.0.0 to use the new flow.

Learn more about the security benefits of PKCE at oauth.com.

Support for GitHub's expiring tokens

Sep 24th, 2020

OneGraph supports expiring tokens for GitHub apps.

You can learn how to enable expiring tokens for your GitHub app in the GitHub docs. You don't need to do anything on OneGraph.

To use your GitHub app with OneGraph, create a custom OAuth client from Auth Services > Custom OAuth on the OneGraph dashboard.

Dashboard Update: Change your app's name

Aug 28th, 2020

It's now possible to change your app's name from the dashboard. Click on the pencil next to the app's name in the App Information card to edit it.

👍 1