Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RailsConf 2018: The GraphQL Way: A new path for JSON APIs by Nick Quaranto Have you written JSON APIs in Rails a few times? Even if you’re escaped implementing a “render: :json” call, some day soon you’ll need to get JSON data out to a native client or your front-end framework. Your Rails apps might change, but the pitfalls for JSON APIs stay the same: They’re hard to discover, difficult to change from the client side, and documenting them is a pain. For your next app, or your current one, let’s consider GraphQL. I'll show you how to implement it in your app and offer real-world advice from making it work in an existing Rails app.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In "The GraphQL Way: A new path for JSON APIs," presented at RailsConf 2018 by Nick Quaranto, the video explores the challenges of traditional RESTful JSON APIs in Rails and proposes GraphQL as an effective alternative. **Key Points:** - **Introduction to GraphQL:** - GraphQL is a query language for APIs, designed to overcome common REST issues such as endpoint explosion and low data discoverability. - It was developed by Facebook in 2012 and open-sourced in 2015, becoming increasingly popular among companies like GitHub and Shopify. - **Challenges with REST APIs and JSON: - Traditional REST APIs can lead to difficult-to-manage code, versioning problems, and inefficient data fetching methods. - JSON while useful, does not solve the underlying limitations of RESTful architecture. - **GraphQL Features:** - **Strong Typing:** Ensures all data inputs and outputs are clearly defined, reducing runtime errors due to incorrect data types. - **Change Resilience:** APIs can evolve without the need for versioning, allowing for the addition and depreciation of fields while maintaining backward compatibility. - **Introspection:** Developers can explore API types and structures through tools like GraphiQL, allowing easier debugging and documentation. - **Integration with Existing Rails Applications:** - Quaranto emphasizes that integrating GraphQL requires a rethink of the application's architecture, especially in separating data presentation from logic. - The GraphQL Ruby gem streamlines the integration process, providing tools to define types, schemas, and execute queries and mutations. - **Pitfalls of GraphQL:** - Lack of built-in error handling necessitates the use of additional gems to manage exceptions. - Performance issues, like the N+1 problem, can occur if not handled properly. Batch loading strategies and caching can mitigate these concerns. **Conclusion:** GraphQL presents a modern and robust alternative for building APIs in Rails, particularly for new applications. Its strong typing, change resilience, and developer-friendly tools create an enhanced experience for both developers and users. However, careful consideration of application architecture and performance patterns is essential to successfully implement GraphQL in existing systems.
Suggest modifications
Cancel