This document discusses a presentation about GraphQL and lessons learned from implementing GraphQL APIs. The presentation covers why GraphQL is useful compared to REST APIs, GraphQL concepts like queries and mutations, and examples of implementing GraphQL in Java. It also discusses challenges with REST APIs like over-fetching data, rigid contracts that don't adapt to different clients, and challenges with API versioning.
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
This document discusses a presentation about GraphQL and lessons learned from implementing GraphQL APIs. The presentation covers why GraphQL is useful when REST APIs are insufficient, including issues with rigid REST contracts, overfetching and underfetching data, and supporting multiple client needs. It also provides examples of GraphQL concepts like queries, mutations, fragments, and demonstrates GraphQL in Java. The presentation aims to convey lessons learned from building GraphQL APIs.
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
This document discusses the limitations of REST APIs and how GraphQL addresses those limitations. It begins with examples of how REST APIs can result in underfetching or overfetching data and require multiple roundtrips. It then covers how GraphQL allows clients to specify exactly what data they need in a single request. The document also provides examples of GraphQL queries, mutations, variables, fragments and aliases that simplify data fetching compared to REST APIs.
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
This document discusses the limitations of REST APIs and how GraphQL addresses those limitations. It begins with examples of how REST APIs can result in underfetching or overfetching data and require multiple roundtrips. It then demonstrates how GraphQL allows clients to specify exactly what data they need in a single request. The document also shows how GraphQL is better suited to the needs of different clients compared to rigid REST APIs. Finally, it provides examples of GraphQL queries and mutations.
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
- GraphQL is an alternative to REST APIs that allows clients to specify exactly what data they need from the server in a single request.
- With REST, multiple roundtrips are often needed to fetch nested or related data, but GraphQL allows fetching this data in one request.
- The document discusses implementing GraphQL APIs with Java, including defining the schema, writing data fetchers, and supporting queries, mutations, and other GraphQL features. It also covers lessons learned about understanding abstractions and updating libraries.
[DevCrowd] GraphQL - gdy API RESTowe to za małoMarcinStachniuk
Slajdy z konferencji DevCrowd
Wszyscy znamy architekturę REST do definiowania API naszych aplikacji. Jednak REST ma swoje wady i ograniczenia. To dlatego Facebook stworzył GraphQL jako alternatywę. W mojej prezentacji przedstawię ograniczenia RESTa i jak je rozwiązuje GraphQL. Pokażę składnię, zalety jak i wady. Będzie też o tym jak zaimplementować GraphQL w Javie oraz co jeszcze warto o nim wiedzieć.
GraphQL - when REST API is not enough - lessons learnedMarcinStachniuk
This document discusses lessons learned from implementing GraphQL APIs. It begins by describing some limitations of REST APIs, such as requiring multiple roundtrips to fetch nested data. GraphQL is introduced as an alternative that allows clients to specify exactly what data they need in a single request. The document then covers various GraphQL concepts like queries, mutations, and type systems. It also discusses best practices like using a schema-first approach, pagination support, and the DataLoader library to solve the N+1 problem. Testing GraphQL APIs and integrating with Relay are also briefly outlined. The overall message is that GraphQL is a good alternative to REST when clients have complex data needs.
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
We all know the REST architectural style to define a good API for your applications. However, REST has its disadvantages and constraints. That’s why Facebook developed GraphQL as an alternative.
In my talk, I will present you some REST constraints and how GraphQL solves them. I will talk about how we implemented GraphQL in our application and why.
Get to know our successes… and failures from the first row.
GraphQL - Piękne API w Twojej Aplikacji - KrakowGraphAcademyMarcinStachniuk
Wszyscy znamy i tworzymy API RESTowe. Jednak to podejście ma swoje wady i ograniczenia. Dlatego Facebook stworzył GraphQL jako alternatywę. W mojej prezentacji przedstawię problemy RESTa oraz jak je rozwiązuje GraphQL. Pokażę składnię, jak projektować takie API oraz zalety i wady.
Slajdy z konferencji Confitura 2019.
Wszyscy znamy podejście REST do definiowania API naszych aplikacji. Jednak REST ma swoje wady i ograniczenia. To dla tego Facebook stworzył GraphQL jako alternatywę. W mojej prezentacji przedstawię ograniczenia RESTa i jak je rozwiązuje GraphQL. Pokażę składnię, zalety jak i wady. Będzie też jak zaimplementować GraphQL w Javie oraz co jeszcze warto o nim wiedzieć.
BruJUG Brussels GraphQL when RESR API is to less - lessons learnedMarcinStachniuk
We all know the REST architectural style to define a good API for your applications. However, REST has its disadvantages and constraints. That’s why Facebook developed GraphQL as an alternative.
In my talk, I will present you some REST constraints and how GraphQL solves them. I will talk about how we implemented GraphQL in our application and why.
Get to know our successes… and failures from the first row.
PiterPy #3 talk (Video: https://youtu.be/bCwSyyygSmM). Some points on RAML, general overview and takeaways based on a real project.
Presented with Dmitry Nazarov https://ru.linkedin.com/in/aspectmkn8rd/en (Part 2, as mentioned in contents)
[@IndeedEng] Building Indeed Resume Searchindeedeng
Video available: http://youtu.be/qcnP5gQGBaU
Software engineer David Tulig will dive into the architecture of Indeed’s Resume Instant Search and our use of the Google Closure tools. David will explain how we write maintainable, efficient JavaScript components for Resume Instant Search and other Indeed products. He will discuss how we create templates that run on both client and server, providing fast initial page load time and search engine-friendly pages with the responsiveness of client-side rendering.
Speaker:
David Tulig is a software engineer on the Job Search team at Indeed. David has worked on employer, resume, and job search products during his 4 years at Indeed.
@IndeedEng: Tokens and Millicents - technical challenges in launching Indeed...indeedeng
This document provides an overview of the technical challenges in launching Indeed's job search platform around the world. It discusses how Indeed handles tokenization and indexing of jobs in different languages, including challenges with Chinese, Japanese, and Korean text. It describes Indeed's approaches to language detection, stemming, and query expansion to improve recall and relevance across many international markets. Key techniques discussed include n-gram tokenization, Unicode blocking, Bayesian classification, term expansion maps separated from indexing, and rule-based stemming. The goal is to make Indeed's search system scalable, generic, and able to support comprehensive use cases for job searching in different languages and regions globally.
Vladimir Tsukur presented on hypermedia APIs and HATEOAS. He discussed REST, the Richardson Maturity Model, CRUD vs more advanced APIs, and link relations. He demonstrated Mason, a proposed hypermedia format that uses controls and namespaces to define available state transitions and link semantics.
Hypermedia APIs and HATEOAS / Wix EngineeringVladimir Tsukur
The document discusses hypermedia APIs and the Richardson Maturity Model. It provides examples of different levels of hypermedia support, including link semantics, link outbound relations, embedded links, templated queries, non-idempotent updates, and more. It also covers choosing an appropriate media type like JSON-LD, JSON API or HAL and implementing hypermedia controls, profiles and documentation.
Pascarello_Investigating JavaScript and Ajax Securityamiable_indian
The document discusses JavaScript and Ajax security. It provides background on the presenter and outlines what will be investigated, including the Ajax model, form hacks, cross-site scripting (XSS), and other injections. It then discusses the basics of Ajax, including the XMLHttpRequest object and its methods. It covers potential security issues with Ajax and demonstrates simple scripted attacks on a server.
- Google offers many APIs including data APIs that allow querying and updating structured data from services like Calendar, Blogger, and Spreadsheets using a single API (GData)
- GData uses the Atom Publishing Protocol and format which provides a standardized way to work with resources and data over HTTP while allowing extensions
- While originally intended for blogs, Atom has proven effective for modeling data through its extensibility though it has some constraints for representing certain data types
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) ExtensionVMware Tanzu
This document discusses Geode GraphQL Extension (G2QL), which allows a Geode cache to be accessed via GraphQL queries and mutations. G2QL introspects a Geode cache configuration and generates a corresponding GraphQL schema. It converts GraphQL queries and mutations to Geode region operations and OQL, eliminating the need to write resolvers. G2QL addresses issues like schema duplication, boilerplate code, and inefficient data access through features like schema generation, automatic conversion of queries to Geode operations, and batching of queries. The document provides an example of G2QL in action and discusses next steps for the project.
Video available at: http://youtu.be/y0WC1cxLsfo
At Indeed our applications generate billions of log events each month across our seven data centers worldwide. These events store user and test data that form the foundation for decision making at Indeed. We built a distributed event logging system, called Logrepo, to record, aggregate, and access these logs. In this talk, we'll examine the architecture of Logrepo and how it evolved to scale.
Jeff Chien joined Indeed as a software engineer in 2008. He's worked on jobsearch frontend and backend, advertiser, company data, and apply teams and enjoys building scalable applications.
Jason Koppe is a Systems Administrator who has been with Indeed since late 2008. He's worked on infrastructure automation, monitoring, application resiliency, incident response and capacity planning.
This document provides an introduction and overview of GraphQL, including:
- A brief history of GraphQL and how it was created by Facebook and adopted by other companies.
- How GraphQL provides a more efficient alternative to REST APIs by allowing clients to specify exactly the data they need in a request.
- Some key benefits of GraphQL like its type system, declarative data fetching, schema stitching, introspection, and versioning capabilities.
- Some disadvantages like potential complexity in queries and challenges with rate limiting.
apidays LIVE Paris - Augmenting a Legacy REST API with GraphQL by Clément Vil...apidays
apidays LIVE Paris - Responding to the New Normal with APIs for Business, People and Society
December 8, 9 & 10, 2020
Augmenting a Legacy REST API with GraphQL
Clément Villain, Software Engineer at Fabernovel
Overview of GraphQL
How it is different from REST
When you should consider using it and when you should not
Incremental demos until calling GraphQL from an React application: https://github.com/bary822/graphQL-techtalk
InterCon 2017 - Tudo o que você quer saber sobre GraphQL - Ubiratan SoaresiMasters
This document discusses GraphQL and how it compares to REST APIs. It outlines some common issues with REST APIs like versioning headaches and making multiple requests to fetch needed data. The core concepts of GraphQL are then explained, including how it uses a single endpoint and schema to define the data contract. Queries and mutations are covered as the main operations in GraphQL along with its type system. Potential concerns about using GraphQL for businesses are addressed at the end.
Stanko introduces GraphQL as an alternative to REST for building APIs. Some key problems with REST include over-fetching of data and lack of standardized documentation. GraphQL addresses these by allowing clients to specify exactly which attributes they need in a query. The response then matches the structure of the query. GraphQL also provides automatic documentation of available queries and mutations through an introspection system. Overall, GraphQL provides a more flexible way to retrieve resources from an API compared to REST.
Graphql for Frontend Developers Simplifying Data Fetching.docxssuser5583681
In today’s digital landscape, the demand for efficient and flexible APIs (Application Programming Interfaces) has grown exponentially. Developers are constantly seeking ways to improve data retrieval and manipulation processes while ensuring seamless integration between client applications and server resources. One technology that has gained significant popularity in recent years is GraphQL Server.
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsNicola Molinari
The document describes commercetools' experience with adopting GraphQL for their merchant center application. They were initially fetching category data with multiple REST requests, but were able to fetch it in one GraphQL query along with additional fields like number of subcategories and products. This solved a performance issue and allowed them to easily extend their API. They also migrated other parts of their client to use GraphQL, reducing network requests and complexity. Overall, GraphQL allowed them to optimize queries and extend their API with minimal effort.
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
In this Webinar, will talk on GraphQL with .NET, that provides a modern and flexible approach to building APIs. It empowers developers to create efficient and tailored APIs that meet the specific needs of their applications and clients.
apidays LIVE Paris - GraphQL meshes by Jens Neuseapidays
apidays LIVE Paris - Responding to the New Normal with APIs for Business, People and Society
December 8, 9 & 10, 2020
GraphQL meshes
Jens Neuse, Founder of Wundergraph
Slajdy z konferencji Confitura 2019.
Wszyscy znamy podejście REST do definiowania API naszych aplikacji. Jednak REST ma swoje wady i ograniczenia. To dla tego Facebook stworzył GraphQL jako alternatywę. W mojej prezentacji przedstawię ograniczenia RESTa i jak je rozwiązuje GraphQL. Pokażę składnię, zalety jak i wady. Będzie też jak zaimplementować GraphQL w Javie oraz co jeszcze warto o nim wiedzieć.
BruJUG Brussels GraphQL when RESR API is to less - lessons learnedMarcinStachniuk
We all know the REST architectural style to define a good API for your applications. However, REST has its disadvantages and constraints. That’s why Facebook developed GraphQL as an alternative.
In my talk, I will present you some REST constraints and how GraphQL solves them. I will talk about how we implemented GraphQL in our application and why.
Get to know our successes… and failures from the first row.
PiterPy #3 talk (Video: https://youtu.be/bCwSyyygSmM). Some points on RAML, general overview and takeaways based on a real project.
Presented with Dmitry Nazarov https://ru.linkedin.com/in/aspectmkn8rd/en (Part 2, as mentioned in contents)
[@IndeedEng] Building Indeed Resume Searchindeedeng
Video available: http://youtu.be/qcnP5gQGBaU
Software engineer David Tulig will dive into the architecture of Indeed’s Resume Instant Search and our use of the Google Closure tools. David will explain how we write maintainable, efficient JavaScript components for Resume Instant Search and other Indeed products. He will discuss how we create templates that run on both client and server, providing fast initial page load time and search engine-friendly pages with the responsiveness of client-side rendering.
Speaker:
David Tulig is a software engineer on the Job Search team at Indeed. David has worked on employer, resume, and job search products during his 4 years at Indeed.
@IndeedEng: Tokens and Millicents - technical challenges in launching Indeed...indeedeng
This document provides an overview of the technical challenges in launching Indeed's job search platform around the world. It discusses how Indeed handles tokenization and indexing of jobs in different languages, including challenges with Chinese, Japanese, and Korean text. It describes Indeed's approaches to language detection, stemming, and query expansion to improve recall and relevance across many international markets. Key techniques discussed include n-gram tokenization, Unicode blocking, Bayesian classification, term expansion maps separated from indexing, and rule-based stemming. The goal is to make Indeed's search system scalable, generic, and able to support comprehensive use cases for job searching in different languages and regions globally.
Vladimir Tsukur presented on hypermedia APIs and HATEOAS. He discussed REST, the Richardson Maturity Model, CRUD vs more advanced APIs, and link relations. He demonstrated Mason, a proposed hypermedia format that uses controls and namespaces to define available state transitions and link semantics.
Hypermedia APIs and HATEOAS / Wix EngineeringVladimir Tsukur
The document discusses hypermedia APIs and the Richardson Maturity Model. It provides examples of different levels of hypermedia support, including link semantics, link outbound relations, embedded links, templated queries, non-idempotent updates, and more. It also covers choosing an appropriate media type like JSON-LD, JSON API or HAL and implementing hypermedia controls, profiles and documentation.
Pascarello_Investigating JavaScript and Ajax Securityamiable_indian
The document discusses JavaScript and Ajax security. It provides background on the presenter and outlines what will be investigated, including the Ajax model, form hacks, cross-site scripting (XSS), and other injections. It then discusses the basics of Ajax, including the XMLHttpRequest object and its methods. It covers potential security issues with Ajax and demonstrates simple scripted attacks on a server.
- Google offers many APIs including data APIs that allow querying and updating structured data from services like Calendar, Blogger, and Spreadsheets using a single API (GData)
- GData uses the Atom Publishing Protocol and format which provides a standardized way to work with resources and data over HTTP while allowing extensions
- While originally intended for blogs, Atom has proven effective for modeling data through its extensibility though it has some constraints for representing certain data types
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) ExtensionVMware Tanzu
This document discusses Geode GraphQL Extension (G2QL), which allows a Geode cache to be accessed via GraphQL queries and mutations. G2QL introspects a Geode cache configuration and generates a corresponding GraphQL schema. It converts GraphQL queries and mutations to Geode region operations and OQL, eliminating the need to write resolvers. G2QL addresses issues like schema duplication, boilerplate code, and inefficient data access through features like schema generation, automatic conversion of queries to Geode operations, and batching of queries. The document provides an example of G2QL in action and discusses next steps for the project.
Video available at: http://youtu.be/y0WC1cxLsfo
At Indeed our applications generate billions of log events each month across our seven data centers worldwide. These events store user and test data that form the foundation for decision making at Indeed. We built a distributed event logging system, called Logrepo, to record, aggregate, and access these logs. In this talk, we'll examine the architecture of Logrepo and how it evolved to scale.
Jeff Chien joined Indeed as a software engineer in 2008. He's worked on jobsearch frontend and backend, advertiser, company data, and apply teams and enjoys building scalable applications.
Jason Koppe is a Systems Administrator who has been with Indeed since late 2008. He's worked on infrastructure automation, monitoring, application resiliency, incident response and capacity planning.
This document provides an introduction and overview of GraphQL, including:
- A brief history of GraphQL and how it was created by Facebook and adopted by other companies.
- How GraphQL provides a more efficient alternative to REST APIs by allowing clients to specify exactly the data they need in a request.
- Some key benefits of GraphQL like its type system, declarative data fetching, schema stitching, introspection, and versioning capabilities.
- Some disadvantages like potential complexity in queries and challenges with rate limiting.
apidays LIVE Paris - Augmenting a Legacy REST API with GraphQL by Clément Vil...apidays
apidays LIVE Paris - Responding to the New Normal with APIs for Business, People and Society
December 8, 9 & 10, 2020
Augmenting a Legacy REST API with GraphQL
Clément Villain, Software Engineer at Fabernovel
Overview of GraphQL
How it is different from REST
When you should consider using it and when you should not
Incremental demos until calling GraphQL from an React application: https://github.com/bary822/graphQL-techtalk
InterCon 2017 - Tudo o que você quer saber sobre GraphQL - Ubiratan SoaresiMasters
This document discusses GraphQL and how it compares to REST APIs. It outlines some common issues with REST APIs like versioning headaches and making multiple requests to fetch needed data. The core concepts of GraphQL are then explained, including how it uses a single endpoint and schema to define the data contract. Queries and mutations are covered as the main operations in GraphQL along with its type system. Potential concerns about using GraphQL for businesses are addressed at the end.
Stanko introduces GraphQL as an alternative to REST for building APIs. Some key problems with REST include over-fetching of data and lack of standardized documentation. GraphQL addresses these by allowing clients to specify exactly which attributes they need in a query. The response then matches the structure of the query. GraphQL also provides automatic documentation of available queries and mutations through an introspection system. Overall, GraphQL provides a more flexible way to retrieve resources from an API compared to REST.
Graphql for Frontend Developers Simplifying Data Fetching.docxssuser5583681
In today’s digital landscape, the demand for efficient and flexible APIs (Application Programming Interfaces) has grown exponentially. Developers are constantly seeking ways to improve data retrieval and manipulation processes while ensuring seamless integration between client applications and server resources. One technology that has gained significant popularity in recent years is GraphQL Server.
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsNicola Molinari
The document describes commercetools' experience with adopting GraphQL for their merchant center application. They were initially fetching category data with multiple REST requests, but were able to fetch it in one GraphQL query along with additional fields like number of subcategories and products. This solved a performance issue and allowed them to easily extend their API. They also migrated other parts of their client to use GraphQL, reducing network requests and complexity. Overall, GraphQL allowed them to optimize queries and extend their API with minimal effort.
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
In this Webinar, will talk on GraphQL with .NET, that provides a modern and flexible approach to building APIs. It empowers developers to create efficient and tailored APIs that meet the specific needs of their applications and clients.
apidays LIVE Paris - GraphQL meshes by Jens Neuseapidays
apidays LIVE Paris - Responding to the New Normal with APIs for Business, People and Society
December 8, 9 & 10, 2020
GraphQL meshes
Jens Neuse, Founder of Wundergraph
GraphQL Advanced Concepts A Comprehensive Guide.docxssuser5583681
Welcome to our comprehensive guide on GraphQL Advanced concepts. In this article, we will delve into the intricacies of GraphQL and explore advanced techniques and concepts that will enhance your GraphQL development skills. Whether you are a beginner looking to expand your knowledge or an experienced developer seeking to master GraphQL, this guide will provide you with valuable insights and practical examples to help you level up your GraphQL game.
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays
apidays LIVE Hong Kong 2021 - API Ecosystem & Data Interchange
August 25 & 26, 2021
GraphQL : Beyond APIs, graph your enterprise
Maxime Topolov, CEO of GraphQL Portal
Check out our API conferences @ https://www.apidays.global/
GraphQL: The Missing Link Between Frontend and Backend DevsSashko Stubailo
Engineers working on backend data services are often focused on operational concerns like data consistency, reliability, uptime, and storage efficiency. Because each situation calls for a specific set of tradeoffs, one organization can end up with a diverse set of backend databases and services. For the people building the UI and frontend API layers, this diversity can quickly become an issue, especially if the same client needs to call into multiple backends or fetch related objects across different data sources.
GraphQL is a language-agnostic API gateway technology designed precisely to solve this mismatch between backend and frontend requirements. It provides a highly structured, yet flexible API layer that lets the client specify all of its data requirements in one GraphQL query, without needing to know about the backend services being accessed. Better yet, because of the structured, strongly typed nature of both GraphQL queries and APIs, it's possible to quickly get critical information, such as which objects and fields are accessed by which frontends, which clients will be affected by specific changes to the backend, and more.
In this talk, I'll explain what GraphQL is, what data management problems it can solve in an organization, and how you can try it today.
This document discusses migrating a REST API to a GraphQL API. It covers some of the benefits of GraphQL like getting exactly what is needed from the client side, having a rich type system, and being transport agnostic. It provides examples of defining GraphQL types based on a JSON schema and making requests using those types. It also mentions some tools that can help with building and debugging a GraphQL API as well as some precautions to keep in mind during development.
This is an introduction of GraphQL, an open-source data query and manipulation language for APIs. You can also find the link to the demo and some other resources in the last slides.
Demo: https://github.com/GalassoLuca/introduction-to-graphql
Video: https://speckand.tech/2019/11/web-programming
Taking Control of your Data with GraphQLVinci Rufus
The document discusses how GraphQL provides a solution for problems with traditional REST APIs by allowing flexible data fetching with one query. It summarizes pain points like over-fetching or under-fetching data and inconsistent features between platforms. The document then explains what GraphQL is, how it evolved from internal use at Facebook, popular brands using it, its specifications and implementations in different languages. It demonstrates how GraphQL enables flexible querying of data without versioning or multiple endpoints. The document also covers related tools like GraphiQL, schemas and types, and how GraphQL can be used with React. It concludes by discussing upcoming areas of focus like prioritizing data and supporting real-time updates.
Frontcon Riga - GraphQL Will Do To REST What JSON Did To XMLRoy Derks
GraphQL provides a single endpoint that returns flexible data structures, solving issues with REST such as multiple endpoints, over-fetching and under-fetching of data, and versioning. It allows clients to specify exactly which data they need from the server in a query. GraphQL has gained popularity due to its modern tooling, large developer community, and adoption by many large companies. While REST has multiple endpoints that return fixed data structures, GraphQL is positioned to improve on this by offering more control and flexibility to clients.
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)Rob Crowley
The shift to microservices, cloud native and rich web apps have made it challenging to deliver compelling API experiences. REST, as specified in Roy Fielding’s seminal dissertation, has become the architectural pattern of choice for APIs and when applied correctly allows for clients and servers to evolve in a loosely coupled manner. There are areas however where REST can deliver less than ideal client experiences. Often many HTTP requests are required to render a single view.
While this may be a minor concern for a web app running on a WAN with low latency and high bandwidth, it can yield poor client experiences for mobile clients in particular. GraphQL is Facebook’s response to this challenge and it is quickly proving itself as an exciting alternative to RESTful APIs for a wide range of contexts. GraphQL is a query language that provides a clean and simple syntax for consumers to interrogate your APIs. These queries are strongly types, hierarchical and enable clients to retrieve only the data they need.
In this session, we will take a hands-on look at GraphQL and see how it can be used to build APIs that are a joy to use.
Moje slajdy z prezentacji na GraphQL Wroclaw #3 https://www.meetup.com/GraphQL-Wroclaw/events/261828347/
Większość prezentacji dotyczących GraphQL opowiada o JavaSkryptowych narzędziach, natomiast mało kto mówi o tym jak korzystać z GraphQL w Javie. Prezentacja będzie o tym, jak sprawić aby nasz backendowy, Javowy serwer korzystał z GraphQL. Będzie o możliwych podejściach w implementacji, dobrych praktykach i 4-letnim doświadczeniu z GraphQL na produkcji.
[WroclawJUG] Continuous Delivery in OSS using ShipkitMarcinStachniuk
Shipkit is a framework that helps automate continuous delivery of open source software projects. It allows developers to easily manage releases by automatically bumping versions, generating release notes, creating tags, and publishing releases when code is merged to master. Shipkit integrates with Travis CI to run release tasks like tests and publication. It aims to reduce the manual work of releases so developers can focus on coding.
Do you know how Continuous Delivery of Java Open Source libraries looks? How big is your release overhead? Do you update release notes and include contributors manually? How do you handle versioning? Do you use semantic versioning?
During this workshop, you will learn how to set up Continuous Delivery for your library. You’ll never have to manually release new versions again. We will use the following tools: GitHub, TravisCI, Bintray, Maven Central. We will glue everything using Shipkit.org - a project born from Mockito (and still used there). You’ll additionally learn SerVer.
This workshop is mostly for Java open source and Gradle plugins developers. We will use a library prepared especially for this training, so no worries if you don’t have your own open source project (yet).
Prerequisites: GitHub account, Java & Gradle basics.
Automatic mechanism data migration between relational and object databaseMarcinStachniuk
This document discusses automatically migrating data between a relational database and an object database. It presents the problem of impedance mismatch between the different data models and dispersal of data across tables in a relational database. The solution reads the relational database schema, generates object-oriented persistence classes, loads the classes, uses reflection to access the relational data and invoke methods to store it in the object database. Data types are mapped between the databases. Future work could support additional data types, databases and customization.
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
This document discusses continuous delivery in an open source project. It begins with an introduction of the speaker and then discusses various tools used in the continuous delivery process like Travis CI for continuous integration. It outlines the build pipeline for the project including deploying to Bintray and updating GitHub pages. It also covers code quality tools like Codecov and promoting the project on the internet through blogs, conferences and other forums.
Continuous delivery w projekcie open source - Marcin StachniukMarcinStachniuk
Continuous delivery is a software engineering approach where code changes are automatically built, tested, and prepared for a release to production. The presentation discusses setting up a continuous delivery pipeline for an open source project including continuous integration with Travis CI, deploying to Bintray, tracking code quality with Codecov, and promoting the project online. Alternatives to Travis CI, Codecov and other tools are also presented.
Liquibase - Zarządzanie zmianami w relacyjnych bazach danychMarcinStachniuk
Prezentacja wygłoszona na Wrocławskim JUGu 30 września 2015. Prezentacja opisuje w jaki sposób można zarządzać zmianami w relacyjnych bazach danych i jak ten problem rozwiązuje Liquibase.
Poznaj lepiej swoje srodowisko programistyczne i zwieksz swoja produktywnosc ...MarcinStachniuk
Prezentacja do warsztatów na konferencję Warsjawa.pl 2014
Kod, stworzony przez uczestników warsztatu:
https://github.com/mstachniuk/WarsjawaCodingDojo
Podstawy tworzenia gier w J2ME, dla początkujących adeptów sztuki programowaniaMarcinStachniuk
Prezentacja pokazująca podstawy tworzenia gier w technologii J2ME z wykorzystaniem niskopoziomowego API.
Prezentacja dla osób zaczynających przygodę z programowaniem.
Building AI agents with Java and LangChain4jJulien Dubois
This details how to build an AI agent in Java using LangChain4j :
- What are structured outputs
- Using Function Calling
- Creating an MCP Server
- Consuming an MCP server
Presented at the Seattle Java User Group on May, 23rd 2025
Download Link 👇
https://techblogs.cc/dl
Free Download Lightworks Pro for Windows PC to edit your videos like a pro and unleash your creative potential for all to see.
A tailored CRM that helps insurance agents streamline interactions, enhance engagement, and drive growth through automation and centralized data. Visit https://www.damcogroup.com/insurance/crm-software for more details!
How OnePlan & Microsoft 365 Ensure Strategic Alignment with AI-Powered Portfo...OnePlan Solutions
Organizations must double down on high-impact initiatives and cut low-value efforts. In this session, see how OnePlan, built on Microsoft 365, helps organizations make informed, AI-powered prioritization decisions, optimize funding, and reallocate constrained resources for maximum impact.
Insurance broker software enables brokers to streamline and simplify client management. It is a comprehensive solution to boost productivity and consolidate business data. Let’s have a look at the features that every good insurance broking software must possess. Explore more - https://www.damcogroup.com/insurance/brokeredge-broker-management-software
Skilling up your dev team - 8 things to consider when skilling-up your dev teamDerk-Jan de Grood
Slides of my DevOps Pro
Europe 2025 presentation Vilnius:
Most IT organizations face challenges of being underskilled or understaffed, making it difficult to find skilled developers and manage workload efficiently. This leads to risks, dependencies, and delays, particularly when critical tasks depend on a few key developers.
Investing in employee development is crucial for improving performance and attracting talent, but it requires strategic planning and collaboration. Companies are aware of this, so why do they keep failing?
Successful upskilling involves team autonomy, leadership buy-in, and dedicated focus. This presentation outlines eight key considerations for effective upskilling: defining clear roles, identifying needed skills, conducting gap analyses, planning for future needs, exploring diverse training methods, securing leadership support, actively monitoring progress, and embedding upskilling into HR processes. By addressing these aspects, organizations can foster technical excellence and continuous improvement.
We’re honored to share the official keynote presentation that opened CFCamp 2025, led by Luis Majano, creator of ColdBox, BoxLang, and CEO of Ortus Solutions.
This PDF features the full slide deck from Day 1’s keynote, where Luis presented a powerful vision for the future of modern CFML development, highlighted the evolution of BoxLang, and shared how Ortus is helping shape a dynamic future for developers around the world.
A heartfelt thank you to the CFCamp team for the opportunity to lead the keynote and showcase the innovation, community, and open source spirit driving the next chapter of CFML. 🚀
Multiple Platforms of Unity Game Development.pdfNova Carter
Unity Game Development stands out for its unparalleled flexibility across multiple platforms, making it a top choice for developers aiming to reach a broad audience. With Unity, creators can build a game once and deploy it seamlessly across mobile devices, desktops, gaming consoles, web browsers, and even AR/VR systems. This multi-platform capability reduces development costs and effort while ensuring consistent performance and user experience across devices. Whether targeting casual mobile gamers or console enthusiasts, Unity empowers developers to scale their games effectively and maintain a competitive edge in today’s diverse gaming landscape.
R12.2 Latest Feature Update for oracle release 12Ashish Tarkar
latest version for oralce to update.
Learn more
The latest Oracle Database version is Oracle Database 23ai. Oracle also has Oracle APEX 24.2 and Oracle Forms 14.1.2.0.0. Oracle Database 23ai is a long-term release with AI-centric features.
Here's a more detailed look:
Oracle Database 23ai:
This version is noted for its AI-centric capabilities, including AI Vector Search and JSON Relational Duality Views. It also includes a built-in SQL Firewall for enhanced security. Oracle Database 23ai is available for free for development and testing.
Oracle APEX 24.2:
This is the latest release of Oracle APEX, a low-code development platform for web applications.
Oracle Forms 14.1.2.0.0:
This is the latest version of Oracle Forms, a platform for creating desktop and web applications. One of the most popular database systems worldwide, Oracle, is trusted by some of the biggest businesses in operation. With many different Oracle database versions released, Oracle provides innovative capabilities in many areas, including management, performance, security, and development.
Both database administrators and developers can easily use this database system to create innovative applications for their business operations. The Oracle brand is well known for its continued dedication to paving the future development of upgraded features to better assist businesses, small and large, with their data management needs. Currently, the latest Oracle versions include Oracle Database 19c (Long Term Release), 21c (Innovation Release), and the newly released, 23c (Long Term Release).
Oracle Database 19c (Long-Term Release):
Released in January 2019 as part of the long-term release for the 12.2 product family, Oracle Database 19c brings stability and extended support until April 30, 2027. Premier support is available until April 30, 2026. Notable features include Query Quarantine for managing system resources, enhanced JSON support with simplified syntax and SODA APIs, and automatic indexing using Machine Learning algorithms for improved performance. The introduction of hybrid partitioned tables allows for efficient management both inside and outside the database.
Oracle Database 21c (Innovation Release):
Oracle Database 21c, released as an innovation release, provides early insights into enhancements and new capabilities. Premier support is available until April 30, 2024, with no extended support. While not eligible for extended support, 21c includes limited quarterly release updates (RUs). The innovation release model allows users to experience cutting-edge technologies for developing or deploying new applications.
Oracle Database 23c (Long-Term Release):
Oracle Database 23c, known by its codename "App Simple," marks the next significant leap in Oracle's commitment to simplifying the development and operation of data-driven applications. Released on September 19, 2023, this long-term release (LTR) builds upon the foundation of Oracle Database 21c's innovation
Scaling up your Snapshot tests, without the frictionarnold844201
We talk about why most companies give up on snapshot tests, and how you can improve your tooling to scale up your snapshot testing (and testing) efforts
Insurance claims processing is complex and regulation-heavy. To ensure accuracy and speed, insurers should leverage robust claims management software. Learn more: https://www.damcogroup.com/insurance/claims-management-software
BIS Safety Software Canada - EHS SOFTWAREBIS Safety
Managing safety, health, and environment programs shouldn’t feel overwhelming. This EHS software acts as a step-by-step solution—helping teams track incidents, run inspections, manage compliance, and stay organized. It's like having a complete safety program in one easy-to-use platform.
Ready to simplify your safety program? Get started with EHS software today.
Menu in Android (Define,Create,Inflate and Click Handler)Nabin Dhakal
In Android, a **menu** provides options for user actions and navigation in an app. Menus can appear as **options menus** (accessed via the app bar), **context menus** (triggered by long-press), or **popup menus** (small floating lists). They are typically defined in XML using `<menu>` and `<item>` tags and inflated using `MenuInflater` in activities or fragments. Developers handle menu item clicks using `onOptionsItemSelected()` or similar methods. Menus help improve usability by grouping actions in a consistent interface. Common use cases include settings, search, and sharing options, offering a clean and accessible way to enhance app functionality.
Menus in Android offer a consistent and user-friendly way to present actions and navigation options within an app. By using options menus for global actions, context menus for specific UI elements, and popup menus for flexible interaction, developers can enhance the overall usability and functionality of their applications. Proper implementation of menus not only organizes actions effectively but also improves the user experience by making key features easily accessible.
Web Application Development A Comprehensive Guide for 2025.pdfSecuodsoft
This comprehensive guide explores everything you need to know about web application development in 2025—covering essential concepts, types of web applications, reasons to build them, the complete development lifecycle, essential tools and frameworks, common challenges, and emerging trends.
For More Info: https://www.secuodsoft.com/blog/web-development/web-application-development-a-comprehensive-guide-for-2025.php
📄 Getting Started with BoxLang – CFCamp 2025 Session with Luis Majano
Explore the foundations of BoxLang, the next-generation dynamic JVM language created by Ortus Solutions, in this introductory session led by its creator, Luis Majano, at CFCamp 2025.
This PDF contains the full slide deck from the session, walking attendees through the key concepts, syntax, and use cases of BoxLang, along with live coding examples and tips for building modern web applications. Ideal for developers seeking hands-on experience with a language designed to be modular, productive, and future-proof.
A special thank you to the CFCamp team for providing us with the space to share our vision and help the community take its first steps with BoxLang. 🌐
Frontier AI Regulation: What form should it take?Petar Radanliev
Frontier AI systems, including large-scale machine learning models and autonomous decision-making technologies, are deployed across critical sectors such as finance, healthcare, and national security. These present new cyber-risks, including adversarial exploitation, data integrity threats, and legal ambiguities in accountability. The absence of a unified regulatory framework has led to inconsistencies in oversight, creating vulnerabilities that can be exploited at scale. By integrating perspectives from cybersecurity, legal studies, and computational risk assessment, this research evaluates regulatory strategies for addressing AI-specific threats, such as model inversion attacks, data poisoning, and adversarial manipulations that undermine system reliability. The methodology involves a comparative analysis of domestic and international AI policies, assessing their effectiveness in managing emerging threats. Additionally, the study explores the role of cryptographic techniques, such as homomorphic encryption and zero-knowledge proofs, in enhancing compliance, protecting sensitive data, and ensuring algorithmic accountability. Findings indicate that current regulatory efforts are fragmented and reactive, lacking the necessary provisions to address the evolving risks associated with frontier AI. The study advocates for a structured regulatory framework that integrates security-first governance models, proactive compliance mechanisms, and coordinated global oversight to mitigate AI-driven threats. The investigation considers that we do not live in a world where most countries seem to be wishing to follow our ideals, for various reasons (competitiveness, geo-political dominations, hybrid warfare, loss of attractiveness of the European model in the Big South, etc.), and in the wake of this particular trend, this research presents a regulatory blueprint that balances technological advancement with decentralised security enforcement (i.e., blockchain).
3. Agenda
11:00
● Why?
● Concepts
● Basics
12:00 Lunch
13:00
● GraphQL in Java
● Lessons learned
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
Monady w .NET – i tak używasz, więc dowiedz się, o co chodzi.
Mateusz Stasch
Rewolucja w analizie danych z RevoscaleR oraz RevoscalePy
Tomasz Krawczyk
Scale it the easy way - introduction to micro frontends
Jakub Holak
4. Who is using REST?
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
5. REST - REpresentational State Transfer
https://api.example.com/customers/123
DELETE
PUT
POST
GET
PATCH
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
11. Different clients - different needs
/web /iphone /android /tv
Application
Web iPhone Android TV
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
12. Different clients - different needs
/web /iphone /android /tv
Application
Web iPhone Android TV
Content-Type: application/vnd.myawesomecorporation.com+v1+web+json
iphone
android
tv
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
13. Different clients - different needs
/web /iphone /android /tv
Application
Web iPhone Android TV
Content-Type: application/vnd.myawesomecorporation.com+v1+web+json
iphone
android
tv
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
14. REST contract is rigid
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
16. REST API Versioning
GET /v2/customers/111RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
GET /customers/111?v=v2RE
ST
GET /customers/111 Accept header: application/vnd.myapp.2+jsonRE
ST
GET /customers/111 Custom header: x-ms-version:2RE
ST
● How to migrate?
● How to document?
● Is versionless API possible?
● What about continuous evolution of API?
19. GraphQL
● Graph Query Language
● Published by Facebook in 2015
● Growth from Facebook Graph API
● Reference implementation in JavaScript
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
20. GraphQL main concepts
● One endpoint for all operations
● Always define in request what you need
● Queries, Mutations and Subscriptions
● Defined by schema
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
21. Data is a graph
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
22. GraphQL time for demo
● Fragments
● Aliases
● Directives
● Interfaces
● Unions
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
● Query
● Syntax Error
● Mutation
● Operation name
● Variables
23. GraphQL Simple API
GET /customers/2?fields=id,name,email
type Customer {
#fields with ! are not null
id: ID!
name: String!
email: String!
}
type Query {
customer(id: String!): Customer!
}
{
"data": {
"customer": {
"id": "2",
"name": "name",
"email": "[email protected]"
}
}
}
{
customer(id: "2") {
id
name
email
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
24. GraphQL Bad Request
GET /custo!@#$ -> 404
{
"data": null,
"errors": [
{
"message": "Invalid Syntax",
"locations": [
{
"line": 2,
"column": 8
}
],
"errorType": "InvalidSyntax",
"path": null,
"extensions": null
} ] }
{
custo!@#$
}
RE
ST
http.cat/200
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
25. Go back to the roots
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
26. GraphQL Simple API
GET /customers/2?fields=id,name,email,company(id,name)
type Customer {
id: ID!
name: String!
email: String!
company: Company
}
type Company {
id: ID!
name: String!
website: String!
}
type Query {
customer(id: String!): Customer!
}
{
"data": {
"customer": {
"id": "2",
"name": "name",
"email": "[email protected]",
"company": {
"id": "211",
"name": "Company Corp."
}
}
}
}
{
customer(id: "2") {
id
name
email
company {
id
name
}
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
27. GraphQL Simple API
GET /customers/2?fields=id,name,email,orders(id,status)
type Customer {
id: ID!
name: String!
email: String!
company: Company
orders: [Order]
}
type Order {
id: ID!
status: Status
}
enum Status {
NEW, CANCELED, DONE
}
{
"data": {
"customer": {
"id": "2",
"name": "name",
"orders": [
{
"id": "55",
"status": "NEW"
},
{
"id": "66",
"status": "DONE"
}
] } } }
{
customer(id: "2") {
id
name
orders {
id
status
}
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
28. GraphQL mutations
input CreateCustomerInput {
name: String
email: String
clientMutationId: String!
}
type CreateCustomerPayload {
customer: Customer
clientMutationId: String!
}
type Mutation {
createCustomer(input: CreateCustomerInput):
CreateCustomerPayload!
}
{
"data": {
"createCustomer": {
"customer": {
"id": "40",
},
"clientMutationId":
"123"
}
}
}
POST /customers PUT /customers/123 DELETE /customers/123 PATCH /customers/123
mutation {
createCustomer(input: {
name: "MyName"
email: "[email protected]"
clientMutationId: "123"
}) {
customer {
id
}
clientMutationId
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
29. GraphQL mutations + operation name
mutation crCust {
createCustomer(input: {
name: "MyName"
email: "[email protected]"
clientMutationId: "123"
}) {
customer {
id
}
clientMutationId
}
}
{
"data": {
"createCustomer": {
"customer": {
"id": "40",
},
"clientMutationId":
"123"
}
}
}
POST /customers PUT /customers/123 DELETE /customers/123 PATCH /customers/123RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
mutation {
createCustomer(input: {
name: "MyName"
email: "[email protected]"
clientMutationId: "123"
}) {
customer {
id
}
clientMutationId
}
}
30. GraphQL Variables
{
"data": {
"createCustomer": {
"customer": {
"id": "40",
},
"clientMutationId":
"123"
}
}
}
POST /customers PUT /customers/123 DELETE /customers/123 PATCH /customers/123
mutation crCust {
createCustomer(input: {
name: "MyName"
email: "[email protected]"
clientMutationId: "123"
}) {
customer {
id
}
clientMutationId
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
mutation crCust ($input: CreateCustInput) {
createCustomer(input: $input) {
customer {
id
}
clientMutationId
}
}
{
"input": {
"name": "MyName 2",
"email": "[email protected]",
"clientMutationId": "123"
}
}
31. GraphQL Aliases
GET /customers/2?fields=id,name,email +
{
"data": {
"cust1": {
"id": "2",
"name": "name",
"email": "[email protected]"
},
"cust2": {
"id": "3",
"name": "John Doe",
"email": "[email protected]"
}
}
}
query get2Cust {
cust1: customer(id: "2") {
id
name
email
}
cust2: customer(id: "3") {
id
name
email
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
GET /customers/3?fields=id,name,emailRE
ST
32. GraphQL Fragment
GET /customers/2?fields=id,name,email +
{
"data": {
"cust1": {
"id": "2",
"name": "name",
"email": "[email protected]"
},
"cust2": {
"id": "3",
"name": "John Doe",
"email": "[email protected]"
}
}
}
query get2Cust {
cust1: customer(id: "2") {
... frag1
}
cust2: customer(id: "3") {
... frag1
}
}
fragment frag1 on Customer {
id
name
email
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
GET /customers/3?fields=id,name,emailRE
ST
33. GraphQL Directive
GET /customers/2?fields=id,name
{
"data": {
"customer": {
"id": "2",
"name": "name"
}
}
}
query getCust ($showEmail: Boolean!) {
customer(id: "2") {
id
name
email @include(if: $showEmail)
}
}
{
"showEmail": false
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
34. GraphQL Interface
GET /users?fields=id,name,superAdmin,permissions
type Query {
users: [User]
}
interface User {
id: ID!
name: String!
email: String!
}
type Admin implements User {
superAdmin: Boolean! // + id...
}
type Moderator implements User {
permissions: [String] // + id...
}
{
"data": {
"users": [
{
"id": "777",
"name": "Admin a",
"superAdmin": true
},
{
"id": "888",
"name": "Moderator",
"permissions": [
"Delete Customer",
"Delete comment"
]}]}}
query getUsers {
users {
... on Admin {
id
name
superAdmin
}
... on Moderator {
id
name
permissions
}
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
35. GraphQL Union
GET /search?input=a?fields=typename,name
type Query {
search(input: String):
[SearchResult]
}
union SearchResult =
Customer |
Admin |
Moderator
{
"data": {
"search": [
{
"__typename": "Customer",
"name": "name"
},
{
"__typename": "Admin",
"name": "Admin a"
},
{
"__typename": "Moderator",
"name": "Moderator"
}]}}
query searchSmth {
search(input: "a") {
__typename
... on Customer {
name
}
... on Admin {
name
}
... on Moderator {
name
}
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
39. GraphQL - when REST API is
not enough - lessons learned
Part 2
Marcin Stachniuk
8 October 2018
40. Agenda
11:00
● Why?
● Concepts
● Basics
12:00 Lunch
13:00
● GraphQL in Java
● Lessons learned
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
Serverless .NET on AWS
Wojciech Gawroński
Lunch
41. GraphQL
● Graph Query Language
● Published by Facebook in 2015
● Growth from Facebook Graph API
● Reference implementation in JavaScript
● First version of Java Library: 18 Jul 2015
https://github.com/graphql-java/graphql-java
● First usage: 21 Sep 2015
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
42. Lessons Learned #1
Never add a library to your project
few days after init release
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
● No community
● A lot of bugs
● Bad documentation
● Strict following reference
implementation and specification
DO NOT TRY
THIS AT WORK
43. GraphQL Simple API
GET /customers/2?fields=id,name,email,orders(id,status)
type Customer {
id: ID!
name: String!
email: String!
company: Company
orders: [Order]
}
type Order {
id: ID!
status: Status
}
enum Status {
NEW, CANCELED, DONE
}
{
"data": {
"customer": {
"id": "2",
"name": "name",
"orders": [
{
"id": "55",
"status": "NEW"
},
{
"id": "66",
"status": "DONE"
}
] } } }
{
customer(id: "2") {
id
name
orders {
id
status
}
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
44. How to implement DataFetcher for queries
GET /customers/2?fields=id,name,email,orders(id,status)
@Component
public class CustomerFetcher extends PropertyDataFetcher<Customer> {
@Autowired
private CustomerService customerService;
@Override
public Customer get(DataFetchingEnvironment environment) {
String id = environment.getArgument("id");
return customerService.getCustomerById(id);
}
}
RE
ST
{
customer(id: "2") {
id
name
orders {
id
status
}
}
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
45. How to implement DataFetcher for queries
GET /customers/2?fields=id,name,email,orders(id,status)
public class Customer {
private String id;
private String name;
private String email; // getters are not required
}
RE
ST
{
customer(id: "2") {
id
name
orders {
id
status
}
}
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
public class OrderDataFetcher extends PropertyDataFetcher<List<Order>> {
@Override
public List<Order> get(DataFetchingEnvironment environment) {
Customer source = environment.getSource();
String customerId = source.getId();
return orderService.getOrdersByCustomerId(customerId);
}
}
46. GraphQL mutations
input CreateCustomerInput {
name: String
email: String
clientMutationId: String!
}
type CreateCustomerPayload {
customer: Customer
clientMutationId: String!
}
type Mutation {
createCustomer(input: CreateCustomerInput):
CreateCustomerPayload!
}
{
"data": {
"createCustomer": {
"customer": {
"id": "40",
},
"clientMutationId":
"123"
}
}
}
POST /customers PUT /customers/123 DELETE /customers/123 PATCH /customers/123
mutation {
createCustomer(input: {
name: "MyName"
email: "[email protected]"
clientMutationId: "123"
}) {
customer {
id
}
clientMutationId
}
}
RE
ST
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
47. How to implement DataFetcher for mutations
POST /customers PUT /customers/123 DELETE /customers/123 PATCH /customers/123
@Component
public class CreateCustomersFetcher extends
PropertyDataFetcher<CreateCustomersPayload> {
@Override
public CreateCustomerPayload get(DataFetchingEnvironment env) {
Map<String, Object> input = env.getArgument("input");
String name = (String) input.get("name");
String email = (String) input.get("email");
String clientMutationId = (String) input.get("clientMutationId");
Customer customer = customerService.create(name, email);
return new CreateCustomerPayload(customer, clientMutationId);
}
RE
ST
mutation {
createCustomer(input: {
name: "MyName"
email: "[email protected]"
clientMutationId: "123"
}) {
customer {
id
}
clientMutationId
}
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
48. In case Interfaces and Unions - Type Resolver is needed
public class UserTypeResolver implements TypeResolver {
@Override
public GraphQLObjectType getType(TypeResolutionEnvironment env) {
Object javaObject = env.getObject();
if (javaObject instanceof Admin) {
return env.getSchema().getObjectType("Admin");
} else if (javaObject instanceof Moderator) {
return env.getSchema().getObjectType("Moderator");
} else {
throw new RuntimeException("Unknown type " + javaObject.getClass().getName());
}
}
}
public interface User {...}
public class Admin implements User {...}
public class Moderator implements User {...}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
49. Glue everything together
RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring()
.type("Query", builder ->
builder.dataFetcher("customer", customerFetcher))
.type("Mutation", builder ->
builder.dataFetcher("createCustomer", createCustomerFetcher))
.type(newTypeWiring("User")
.typeResolver(new UserTypeResolver())
.build())
...
.build();
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
50. Abstraction over GraphQL Java
Our abstraction
Data Fetcher 2
Inputs mapping to objects
Schema definition
Pagination
...
Data Fetcher 1 Data Fetcher N...
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
51. Lessons Learned #2
Abstraction is not good if you don’t understand
how it works under the hood
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
● Copy paste errors
● Wrong usage
● Hard to update to new version
52. GraphQL type system
How to define your schema?
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
53. Code First approach
private GraphQLFieldDefinition customerDefinition() {
return GraphQLFieldDefinition.newFieldDefinition()
.name("customer")
.argument(GraphQLArgument.newArgument()
.name("id")
.type(new GraphQLNonNull(GraphQLString)))
.type(new GraphQLNonNull(GraphQLObjectType.newObject()
.name("Customer")
.field(GraphQLFieldDefinition.newFieldDefinition()
.name("id")
.description("fields with ! are not null")
.type(new GraphQLNonNull(GraphQLID))
.build())
….
.build()))
.dataFetcher(customerFetcher)
.build();
}
Schema First approach
type Query {
customer(id: String!): Customer!
}
type Customer {
#fields with ! are not null
id: ID!
name: String!
email: String!
company: Company
orders: [Order]
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
54. Code First approach - How to build
Introspection
query
Introspection
response
Replace Relay
definitions
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
Typescript relay
plugin
55. Schema First approach
type Customer {
# fields with ! are required
id: ID!
name: String!
email: String!
company: Company
orders: [Order]
}
*.graphqls
SchemaParser schemaParser = new SchemaParser();
File file = // ...
TypeDefinitionRegistry registry = schemaParser.parse(file);
SchemaGenerator schemaGenerator = new SchemaGenerator();
RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring()
.type("Query", builder ->
builder.dataFetcher("customer", customerFetcher))
// ...
.build();
return schemaGenerator.makeExecutableSchema(registry, runtimeWiring);
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
56. Schema First approach - project building diagram
model.graphqls
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
57. GraphQL SPQR
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
https://github.com/leangen/graphql-spqr
SPQR - Senatus Populusque Romanus
58. SPQR approach
public class UserService {
@GraphQLQuery(name = "user")
public User getById(@GraphQLArgument(name = "id") Integer id) {
//...
}
}
public class Customer {
//...
@GraphQLQuery(name = "name", description = "A person's name")
public String getName() {
return name;
}
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
59. Lessons Learned #3
Code First Approach is the worst
Schema First Approach:
● Easy to maintain and
understand
● Helps organise work
● Demo schema is 3x smaller
GraphQL SPQR - ?
Code First approach:
● Hard to maintain
● It was the only way at the
beginning to define a schema
● No possibility to mix both
● No easy way to migrate to
Schema First
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
60. From Code First to Schema First migration
https://github.com/mstachniuk/graphql-schema-from-introspection-generator
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
61. GraphQL - How to define pagination, filtering, sorting?
Pagination:
● before, after
● offset, limit
Filtering:
● filter(name: “Bob” email: “%@gmail.com”)
● filter: {
OR: [{
email: “%@gmail.com”
}]
}, name: “Bob”
}
Sorting:
● orderBy: ASC, DESC
● sort: NEWEST, IMPORTANCE
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
62. Lessons Learned #4
GraphQL is not full query language
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
● Flexibility
● Less common conventions
● Dgraph.io created GraphQL+-
64. GraphQL downsides: N+1 problem
{
customers { 1 call
id
name
orders { n calls
id
status
}
}
}
java-dataloader
● Add async BatchLoader
● Add caching
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
graphQL = GraphQL.newGraphQL(schema)
.queryExecutionStrategy(
new BatchedExecutionStrategy())
.build();
+ @Batched in DataFetcher#get()
65. Lessons Learned #5
If you have N + 1 problem
use java-dataloader
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
66. Complex Queries
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
...
}
}
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
graphQL = GraphQL.newGraphQL(schema)
.instrumentation(
new ChainedInstrumentation(asList(
new MaxQueryComplexityInstrumentation(200),
new MaxQueryDepthInstrumentation(20)
)))
.build();
67. Lessons Learned #6
Performance killer?
Define instrumentation!
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
68. GraphQL downsides: Bad GraphQL API definition - examples
{
customer(id: "2") { … }
customerFull(id: "2") { … }
customerFull2(id: "2") { … }
customerWithDetails(id: "2") { … }
...
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
{
customer(id: "2") {
id
name
orders {
id
status
}
}
}
69. GraphQL downsides: Bad GraphQL API definition - examples
query getUser {
user(id: "123") {
... on Admin {
id
superAdmin
}
... on Moderator {
id
permissions
}
}
}
{
admin(id: "123") {
id
superAdmin
}
moderator(id: "123") {
id
permissions
}
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
70. GraphQL downsides: Bad GraphQL API definition - examples
{
orders (input: {
status: "NEW"
first: "2"
offset: "3"
}, first: "1", offset: "3") {
Items { … }
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
71. Lessons Learned #7
Thinking shift is a key
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
● Let’s think in graphs and NOT in
endpoints / resources / entities / DTOs
● Bad design of our API
73. Testing GraphQL
@SpringBootTest
@ContextConfiguration(classes = Main)
class CustomerFetcherSpec extends Specification {
@Autowired
GraphQLSchema graphQLSchema
GraphQL graphQL
def setup() {
graphQL = GraphQL.newGraphQL(graphQLSchema).build()
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
74. Testing GraphQL
def "should get customer by id"() {
given:
def query = """{ customer(id: "2") { … } }"""
def expected = [ "customer": [ … ] ]
when:
def result = graphQL.execute(query)
then:
result.data == expected
}
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
75. Lessons Learned #8
Testing is easy
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
Trap Adventure 2 - "The Hardest Retro Game"
76. Versioning
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
GraphQL takes a strong opinion on avoiding
versioning by providing the tools for the
continuous evolution of a GraphQL schema.
Src: https://graphql.org/learn/best-practices/#versioning
77. Versioning
type Query {
customer(id: String!): Customer! @deprecated(reason: "not used ...")
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
78. Lessons Learned #9
Versioning is not a problem
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
GET /v2/customers/111RE
ST
GET /customers/111?v=v2RE
ST
GET /customers/111 Accept header: application/vnd.myapp.2+jsonRE
ST
GET /customers/111 Custom header: x-ms-version:2RE
ST
Versioning problem is different
81. Tools Relay
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned @MarcinStachniukGraphQL - when REST API is not enough - lessons learned
user(...) {
photo(width: "120", height: "120")
}
user(...) {
name
}
user(...) {
email
}
user(...) {
name
email
photo(width: "120", height: "120")
}
84. More libraries and projects related to graphql-java
https://github.com/graphql-java/awesome-graphql-java
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
● Generates a GraphQL schema from a JDBC data source
● Annotations-based syntax for GraphQL schema definition
● JPA Implementation of GraphQL (builds on graphql-java)
● And more examples
85. Apollo
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
Build a universal GraphQL API on top of your existing REST
APIs, so you can ship new application features fast without
waiting on backend changes.
86. Lessons Learned #10
Tooling is nice
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
now
87. Summary
GraphQL Pros:
● Nice alternative to REST
● It can be used together with REST
● Good integration with Relay / ReactJS
● You get exactly what you want to get
● Good for API with different clients
● Good to use on top of existing API
● Self documented
● Easy testing
● Nice tooling
● Thin layer
GraphQL Cons:
● High entry barrier
● Hard to return simple Map
● Not well know (yet)
● Performance overhead
● A lot of similar code to write
● No Operation Idempotency
● No Cache & Security
● No Authorisation
● Always HTTP 200 -
unsupported tools
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned
88. Nothing is a silver bullet
@MarcinStachniukGraphQL - when REST API is not enough - lessons learned