Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
When my team took the plunge to migrate Square’s largest Ruby app to GraphQL, no way were we going to manually redefine over 200 objects. Implementing a GraphQL layer includes repetitive and straightforward processes that can be expedited with metaprogramming. I will start with some GraphQL basics, then dig into process of metaprogramming a GraphQL layer from a demo ruby server. I will explain the benefits of using this design pattern and how it improves developer experience. At the end, I will demo the server handling a set diverse and complex client calls! RubyKaigi 2019 https://rubykaigi.org/2019/presentations/gao_shawnee.html#apr18
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 her presentation at RubyKaigi 2019, Shawnee Gao discusses the migration of Square's largest Ruby application to GraphQL, exploring metaprogramming as a solution to simplify the process. This talk begins with an introduction to GraphQL, comparing it to REST and highlighting its capacity to manage complex data queries efficiently, particularly in environments with numerous interlinked data sources. Key points of the discussion include: - **Complexity in Application Architecture**: Gao illustrates how Square's monolithic application, consisting of over 273 thousand lines of Ruby and numerous controllers, required a more scalable solution to model increasingly intricate business relationships. - **GraphQL Basics**: A foundational understanding of GraphQL is established, outlining how it allows clients to tailor queries to their needs, significantly reducing under-fetching and over-fetching issues associated with REST APIs. - **Metaprogramming for Efficiency**: Gao emphasizes the use of metaprogramming to automate repetitive tasks in defining GraphQL types and endpoints, thus improving developer experience while maintaining flexibility in the codebase. - **Implementation of a GraphQL Layer**: The process includes the transition from a REST layer to GraphQL for handling client-server interactions, highlighting the flexibility in maintaining both systems during the transition. - **Defining Targets and Schema Creation**: The concept of targets as a unified data access layer is introduced, alongside the creation of GraphQL type classes through metaprogramming techniques to enhance the coding process. - **Handling Permissions and Security**: Structured authentication and permission checks were stressed as essential for maintaining data security, particularly when handling sensitive information like credit card details. - **Testing and Documentation**: The complexity of writing tests in a metaprogrammed environment is discussed, emphasizing how efficient testing methodologies can validate the functionality of APIs without overcomplicating the testing process. In conclusion, Gao highlights the advantages of using metaprogramming in GraphQL implementations, including improved flexibility, reduced boilerplate code, and a positive impact on developer efficiency. She encourages attendees to reach out for further discussions about opportunities at Square, particularly for those interested in development. Questions from the audience focus on handling documentation within generated schemas and performance optimizations, both of which play critical roles in a successful GraphQL implementation.
Suggest modifications
Cancel