Frequently Asked Questions

Features & Capabilities

What features does Hygraph offer?

Hygraph provides a GraphQL-native architecture, content federation, and scalability. Key features include rapid content delivery, intuitive user interface, robust integrations, and support for modern development workflows. Hygraph also offers enterprise-grade security, SSO integrations, audit logs, encryption, and sandbox environments. Learn more about Hygraph features.

Does Hygraph support Swift and iOS development?

Yes, Hygraph provides native Swift (iOS & Mac) examples and supports integration with Swift GraphQL. You can find example projects and code samples in the Hygraph examples repository. This enables developers to efficiently fetch and manage content from Hygraph within Swift applications.

What integrations does Hygraph support?

Hygraph offers a wide range of integrations, including hosting and deployment (Netlify, Vercel), eCommerce (BigCommerce, commercetools, Shopify), localization (Lokalise, Crowdin, EasyTranslate, Smartling), digital asset management (Aprimo, AWS S3, Bynder, Cloudinary, Mux, Scaleflex Filerobot), personalization and AB testing (Ninetailed), artificial intelligence (AltText.ai), and more. See the full list of integrations.

Does Hygraph provide an API?

Yes, Hygraph provides a powerful GraphQL API for efficient content fetching and management. The API is well-documented and supports advanced querying capabilities. Read the Hygraph API Reference for more details.

How does Hygraph optimize content delivery performance?

Hygraph emphasizes optimized content delivery performance, which directly impacts user experience, engagement, and search engine rankings. Rapid content distribution and responsiveness help reduce bounce rates and increase conversions. Learn more about Hygraph performance.

Technical Requirements

Where can I find technical documentation for Hygraph?

Comprehensive technical documentation for Hygraph is available at https://hygraph.com/docs. It covers everything you need to know about building and deploying projects with Hygraph.

How does Hygraph integrate with programming languages and frameworks?

Hygraph integrates smoothly with various programming languages and frameworks, including Swift, Rails, Gatsby, and more. It offers starter templates and example projects to help developers get started quickly. Learn more about integrations.

What is Swift GraphQL and how does it work with Hygraph?

Swift GraphQL is a popular library for working with GraphQL in Swift. It can be used with Hygraph to efficiently fetch and manage content in iOS and Mac applications. Read more about using Swift GraphQL with Hygraph.

Use Cases & Benefits

Who can benefit from using Hygraph?

Hygraph is ideal for developers, IT decision-makers, content creators, project/program managers, agencies, solution partners, and technology partners. It is especially beneficial for modern software companies, enterprises looking to modernize their tech stack, and brands aiming to scale across geographies or improve development velocity. Learn more about Hygraph's use cases.

What problems does Hygraph solve?

Hygraph addresses operational pains (such as reliance on developers for content updates, outdated tech stacks, and clunky content creation), financial pains (high operational costs, slow speed-to-market, expensive maintenance, and scalability challenges), and technical pains (boilerplate code, overwhelming queries, evolving schemas, cache problems, and OpenID integration challenges). See detailed solutions and case studies.

What business impact can customers expect from using Hygraph?

Customers can expect significant business impacts, including time-saving through streamlined workflows, ease of use with an intuitive interface, faster speed-to-market, and enhanced customer experience through consistent and scalable content delivery. These benefits help businesses modernize their tech stack and achieve operational efficiency. (Source: ICPVersion2_Hailey.pdf)

Can you share specific case studies or success stories of customers using Hygraph?

Yes. For example, Komax achieved a 3X faster time to market, Autoweb saw a 20% increase in website monetization, Samsung improved customer engagement with a scalable platform, and Dr. Oetker enhanced their digital experience using MACH architecture. Explore more Hygraph success stories.

What industries are represented in Hygraph's case studies?

Hygraph's case studies span industries such as food and beverage (Dr. Oetker), consumer electronics (Samsung), automotive (AutoWeb), healthcare (Vision Healthcare), travel and hospitality (HolidayCheck), media and publishing, eCommerce, SaaS (Bellhop), marketplace, education technology, and wellness and fitness. See all case studies.

Pricing & Plans

What is Hygraph's pricing model?

Hygraph offers a free forever Hobby plan, a Growth plan starting at $199/month, and custom Enterprise plans. For full details, visit the Hygraph pricing page.

Support & Implementation

How easy is it to get started with Hygraph?

Hygraph is designed for easy onboarding, even for non-technical users. You can sign up for a free-forever account and access resources like documentation, video tutorials, and onboarding guides. For example, Top Villas launched a new project in just 2 months from the initial touchpoint. Get started with Hygraph.

What customer support is available after purchasing Hygraph?

Hygraph offers 24/7 support via chat, email, and phone. Enterprise customers receive dedicated onboarding and expert guidance. All users have access to detailed documentation, video tutorials, and a community Slack channel. Contact Hygraph support.

What training and technical support does Hygraph provide for onboarding?

Hygraph provides 24/7 support, onboarding sessions for enterprise customers, training resources such as video tutorials, documentation, webinars, and Customer Success Managers for expert guidance during onboarding. Learn more about Hygraph support.

How does Hygraph handle maintenance, upgrades, and troubleshooting?

Hygraph offers 24/7 support for maintenance, upgrades, and troubleshooting via chat, email, and phone. Enterprise customers receive dedicated onboarding and expert guidance, and all users can access detailed documentation and the community Slack channel for additional support. Contact Hygraph support.

Security & Compliance

What security and compliance certifications does Hygraph have?

Hygraph is SOC 2 Type 2 Compliant, ISO 27001 Certified, and GDPR compliant. These certifications ensure the highest levels of data protection and security for users. Learn more about Hygraph security features.

How does Hygraph ensure data security and compliance?

Hygraph provides enterprise-grade security features such as SSO integrations, audit logs, encryption at rest and in transit, and sandbox environments to protect sensitive data and meet regulatory standards. Read more about Hygraph security.

Customer Proof & Case Studies

Who are some of Hygraph's customers?

Hygraph's customers include Sennheiser, HolidayCheck, Ancestry, Samsung, Dr. Oetker, Epic Games, Bandai Namco, Gamescom, Leo Vegas, and Clayton Homes. See more customer stories.

What feedback have customers given about Hygraph's ease of use?

Customers have praised Hygraph for its ease of use and intuitive interface, noting that it is 'super easy to set up and use' and that 'even non-technical users can start using it right away.' The user interface is described as logical and user-friendly, making it accessible for both technical and non-technical teams. Read more customer feedback.

Product Information

What is the primary purpose of Hygraph?

Hygraph's primary purpose is to unify data and enable content federation, allowing businesses to create impactful digital experiences. Its GraphQL-native architecture removes traditional content management pain points and offers scalability, flexibility, and efficient data querying. Learn more about Hygraph's mission.

What kind of projects can I build with Hygraph?

Hygraph's versatility allows you to build websites, apps, and unique digital experiences using pre-built projects and schema templates. Resources are available to help you get started quickly. Explore Hygraph starter projects.

Velocity at Scale: Join the Launch of Hygraph’s Latest AI Innovations

Working with Swift and Hygraph

As phone applications become increasingly complex, working with Swift and GraphQL endpoints. This post shows example of working with GraphQL endpoints in Swift.
Craig Tweedy

Written by Craig 

Jan 13, 2022
working-with-graphql-swift-hygraph

Swift is the Apple-backed programming language powering all the iOS applications on your shiny new iPhone.

As more software comes to phone applications, working with GraphQL endpoints in Swift becomes more and more important. We can use the power of Swift’s native language constructs and frameworks in order to rapidly build a solution that can pull data from Hygraph.

In this example, we’ll work with Swift’s native URLSession, setting up services and tooling to allow us to call the Hygraph API. With this tooling, we can retrieve Hygraph products, convert them into native Swift models using Codable, and display those products in a list efficiently.

Instead of creating a Hygraph project from scratch to follow along, you can use the endpoint https://api-eu-central-1.hygraph.com/v2/ck8sn5tnf01gc01z89dbc7s0o/master. All of the Hygraph examples repo on Github use this endpoint, and no authentication is required.

#Getting Started

In XCode, let's create a new project. Select the multi-platform app option, and provide your project a name and organization identifier.

Once the project has loaded, we'll need to do some prep work to get ready for making GraphQL API calls. For this project, we'll be using URLSession and Swift's async/await support, so we'll need to create some extensions and services to support this.

#Prepping ,[object Object]

Create a new file, and call it URLSession+Async. Ensure this file is added to both the iOS and Mac targets.

We'll add in a function to retrieve data using a URLRequest with async support.

extension URLSession {
func getData(from urlRequest: URLRequest) async throws -> (Data, URLResponse) {
try await withCheckedThrowingContinuation { continuation in
let task = self.dataTask(with: urlRequest) { data, response, error in
guard let data = data, let response = response else {
let error = error ?? URLError(.badServerResponse)
return continuation.resume(throwing: error)
}
continuation.resume(returning: (data, response))
}
task.resume()
}
}
}

This method wraps dataTask(with: URLRequest) to allow support for async.

#Creating our GraphQL Operation Structure

We'll need a structure to allow us to create GraphQL operations, which can be sent to our GraphQL API.

Create a class called GraphQLOperation, and fill it with the following code:

struct GraphQLOperation : Encodable {
var operationString: String
private let url = URL(string: "your graphql endpoint")!
enum CodingKeys: String, CodingKey {
case variables
case query
}
init(_ operationString: String) {
self.operationString = operationString
}
func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(operationString, forKey: .query)
}
func getURLRequest() throws -> URLRequest {
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONEncoder().encode(self)
return request
}
}

This structure can take a string, and convert it into a URLRequest to be sent to the API. It does this using Encodable, which is part of the Swift Codable functionality for automatic encoding / decoding of objects.

#Creating our Result Object

We'll need the ability to parse the API response, so let's create GraphQLResult:

struct GraphQLResult<T: Decodable>: Decodable {
let object: T?
let errorMessages: [String]
enum CodingKeys: String, CodingKey {
case data
case errors
}
struct Error: Decodable {
let message: String
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let dataDict = try container.decodeIfPresent([String: T].self, forKey: .data)
self.object = dataDict?.values.first
var errorMessages: [String] = []
let errors = try container.decodeIfPresent([Error].self, forKey: .errors)
if let errors = errors {
errorMessages.append(contentsOf: errors.map { $0.message })
}
self.errorMessages = errorMessages
}
}

Because this structure is a Decodable enabled structure, it is able to decode our GraphQL responses into one of two values: our provided object (a product, for example) or error messages.

#Creating our GraphQL API

Lastly, create one more new file, and call it GraphQLAPI. Again, make sure this is added to both iOS and Mac targets.

In this file, we'll create a method to take a GraphQLOperation, make the request with our URLSession extension, and decode the result into our objects, if possible by proxy of the GraphQLResult structure.

class GraphQLAPI {
func performOperation<Output: Decodable>(_ operation: GraphQLOperation) async throws -> Output {
// Get the URLRequest from the provided operation
let request: URLRequest = try operation.getURLRequest()
// Make the API call
let (data, _) = try await URLSession.shared.getData(from: request)
// Attempt to parse into our `Output`
let result = try JSONDecoder().decode(GraphQLResult<Output>.self, from: data)
guard let object = result.object else {
print(result.errorMessages.joined(separator: "\n"))
throw NSError(domain: "Error", code: 1)
}
return object
}
}

#Retrieving Products

Now that we've got the prep work done, we can start retrieving our products. We'll first need our product model:

struct Product: Decodable, Identifiable {
var id: String = UUID().uuidString
let name: String
let description: String
let price: Int
}

Ensure this object is Decodable in order to work with our operations, and Identifiable so that it can be displayed in a list later on.

Next, let's create the operation:

extension GraphQLOperation {
static var LIST_PRODUCTS: Self {
GraphQLOperation(
"""
{
products {
id
name
description
price
}
}
"""
)
}
}

This is a plain GraphQL string, wrapped in our GraphQLOperation structure in order to work with our API class.

Finally, let's make a function to call the API using our operation. For convenience, we will create a APIService class to handle this:

class APIService {
let api: GraphQLAPI = GraphQLAPI()
func listProducts() async -> [Product] {
return (
try? await self.api.performOperation(GraphQLOperation.LIST_PRODUCTS)
) ?? []
}
}

This uses our LIST_PRODUCTS operation, passing it to our GraphQLAPI's performOperation method. Should the operation complete successfully, the API will automatically decode the response, and return the objects provided as the return type listed in our function - in this case [Product] (a list of Product).

By using try?, we can default the return result if the operation does not complete successfully, in this case returning an empty list. We could also handle the error here in some other way by just using try with a do/catch.

#Displaying Products

Finally, let's display the products.

In our default ContentView (create a new SwiftUI file if you don't have one), we'll need to store our products in the state, by adding to our View structure:

@State var products: [Product] = []

We'll also need a function to retrieve our products using our previously defined function:

func loadProducts() async {
self.products = APIService().listProducts()
}

Finally, let's replace the body with a list and load in the products on view appear:

List(self.products, id: \.id) { product in
Text(product.name)
}.onAppear {
Task.init {
await self.loadProducts()
}
}

And voila! We should now have a working list of products displaying.

I hope you found this useful, and to learn more about Swift with Hygraph, checkout the example for this project on Github

Blog Author

Craig Tweedy

Craig Tweedy

Rock and Roll nerd. Full Time Developer, part time human.

Share with others

Sign up for our newsletter!

Be the first to know about releases and industry news and insights.