How can I connect a Swift application to Hygraph's GraphQL API?
To connect a Swift application to Hygraph's GraphQL API, you can use Swift's native URLSession with async/await support. The Hygraph API endpoint used in the example is https://api-eu-central-1.hygraph.com/v2/ck8sn5tnf01gc01z89dbc7s0o/master, which does not require authentication for demo purposes. You can retrieve data, convert it into native Swift models using Codable, and display it efficiently. For a full implementation, see the Hygraph Swift example on Github. Note: For production use, ensure you handle authentication and error cases appropriately. Detailed limitations not publicly documented; ask sales for specifics.
What is the recommended structure for making GraphQL requests in Swift?
The recommended structure involves creating a GraphQLOperation struct to encode GraphQL queries, a GraphQLResult struct to decode responses, and a GraphQLAPI class to perform operations using async/await. This approach allows you to send GraphQL queries to Hygraph and decode the results into Swift models. For code samples and implementation details, refer to the Hygraph Swift blog post and Github examples. Note: This structure is suitable for demo and learning purposes; production apps should include robust error handling and authentication.
Is authentication required to access Hygraph's demo GraphQL endpoint?
No authentication is required to access the Hygraph demo endpoint https://api-eu-central-1.hygraph.com/v2/ck8sn5tnf01gc01z89dbc7s0o/master. This endpoint is used in public examples and allows unrestricted access for learning and prototyping. For production projects, authentication and access control are recommended. Note: Demo endpoints may have limitations in terms of data persistence and security.
Where can I find starter projects or code examples for integrating Hygraph with Swift?
Starter projects and code examples for integrating Hygraph with Swift are available in the Hygraph examples repository on Github. You can also explore pre-configured starter projects on the Hygraph marketplace starters page. These resources provide ready-to-use templates and code for rapid prototyping. Note: Starter projects are designed for learning and may require customization for production use.
Features & Capabilities
What APIs does Hygraph provide for content delivery and management?
Hygraph offers several APIs:
GraphQL API: Enables precise data fetching and efficient content delivery, supporting both queries and mutations.
Content API: Allows programmatic access and management of CMS content.
Management API: Used for schema, user, and administrative management across projects. For more details, see the API Reference documentation. Note: API usage may be subject to rate limits and authentication requirements for production environments.
What integrations are available with Hygraph for mobile and content projects?
Hygraph supports integrations with platforms such as Cloudinary, Bynder, Filestack, Scaleflex Filerobot (for digital asset management), EasyTranslate (for localization), Netlify and Vercel (for hosting), Mux (for video management), AWS S3 (for object storage), Imgix (for image optimization), Akeneo (for product information management), Adminix, and Plasmic. For a complete list, visit Hygraph's Integrations Page. Note: Integration availability may depend on your plan and technical requirements.
Performance, Security & Compliance
What are Hygraph's performance metrics for API and content delivery?
Hygraph's global API latency typically ranges between 70–100ms, ensuring quick data retrieval. The platform aims for 99.9%+ availability uptime and offers region-based hosting for compliance and performance. Advanced caching mechanisms (Smart Edge Cache) optimize content delivery for high read-throughput and low latency. Note: Actual performance may vary based on project complexity and geographic location.
What security and compliance certifications does Hygraph hold?
Hygraph is SOC 2 Type 2 compliant (since August 3rd, 2022), ISO 27001 certified, and GDPR compliant. The platform offers granular permissions, audit logs, automatic backups, encryption at rest and in transit, and flexible hosting options (shared and dedicated clusters across multiple regions). For more details, visit the Secure Features page. Note: Compliance features may be most relevant for enterprise customers with strict regulatory requirements.
Use Cases & Customer Success
What industries use Hygraph, and are there relevant case studies?
Hygraph is used across industries including SaaS, Marketplace, Education Technology, Media and Publication, Healthcare, Consumer Goods, Automotive, Technology, FinTech, Travel and Hospitality, Food and Beverage, eCommerce, Agency, Online Gaming, Events & Conferences, Government, Consumer Electronics, Engineering, and Construction. Case studies include Komax (3X faster time-to-market), Samsung (15% improved customer engagement), AutoWeb (20% increase in website monetization), Dr. Oetker (global consistency with MACH architecture), HolidayCheck (modular content model), Fitfox (mobile-first product), DTM (user-centric digital transformation), and Statistics Finland (efficient data delivery). For more, see Hygraph's case studies page. Note: Industry-specific limitations not publicly documented; ask sales for specifics.
What business impact can customers expect from using Hygraph?
Customers can expect improved operational efficiency (reduced developer dependency), faster time-to-market (e.g., Komax achieved 3X faster launches), enhanced customer engagement (Samsung improved engagement by 15%), cost savings (AutoWeb saw a 20% increase in monetization), scalability, and global consistency. These impacts are documented in Hygraph's case studies. Note: Actual results may vary based on project scope and implementation.
Pricing & Plans
What is Hygraph's pricing model?
Hygraph offers a Free Forever Developer Account for small projects, self-service plans starting at $199/month for the Growth Plan, and customizable enterprise plans for large-scale businesses. Pricing is transparent and scales with business needs. Overages for API operations and asset traffic are charged automatically for paid plans; free plans are blocked from overages. Discounts are available for students, non-profits, and open-source projects. Transactions are primarily in USD, with EUR available for European customers. For details, visit Hygraph's Pricing Page. Note: Pricing details may change; contact sales for the latest information.
Support & Documentation
What documentation and support resources are available for Hygraph?
Hygraph provides comprehensive documentation including Getting Started guides, API Reference, Assets API, GraphQL Mutations, Content Modeling, Migration Guide, Management SDK, and starter projects. Community support is available via Slack (slack.hygraph.com). For technical guidance, visit Hygraph Documentation. Note: Some advanced topics may require direct support from Hygraph's team.
Limitations & Acknowledged Trade-Offs
Are there any limitations or scenarios where Hygraph may not be the best fit?
Hygraph's demo endpoints are suitable for learning and prototyping but may lack authentication, data persistence, and advanced security features required for production. Some integrations and enterprise features may only be available on paid plans. Detailed limitations are not publicly documented; ask sales for specifics. Best fit for teams seeking GraphQL-native CMS and content federation; teams needing legacy CMS features or highly specialized workflows may want to consider alternatives.
As phone applications become increasingly complex, working with Swift and GraphQL endpoints. This post shows example of working with GraphQL endpoints in Swift.
Last updated by Craig
on Jan 21, 2026
Originally written by Craig
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.
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.
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.
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.
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.
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.
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:
@Statevar products:[Product]=[]
We'll also need a function to retrieve our products using our previously defined function:
funcloadProducts()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{
awaitself.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
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.
As phone applications become increasingly complex, working with Swift and GraphQL endpoints. This post shows example of working with GraphQL endpoints in Swift.
Last updated by Craig
on Jan 21, 2026
Originally written by Craig
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.
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.
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.
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.
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.
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.
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:
@Statevar products:[Product]=[]
We'll also need a function to retrieve our products using our previously defined function:
funcloadProducts()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{
awaitself.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
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.