SlideShare a Scribd company logo
1 of 16
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
+
A query language for your API
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
Query Response
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
GraphQL APIs Are Self Documenting
Users can explore GraphQL APIs using GraphiQL
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
{ “query” : “[Your GraphQL Query]” }
GraphQL Request Body is JSON
JSON contains one field: query
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
https://codetraveler.io/Indy-Xamarin-GraphQL/
@TheCodeTraveler https://codetraveler.io/indy-xamarin-graphql/
https://codetraveler.io/Indy-Xamarin-GraphQL/

More Related Content

Similar to Xamarin + GraphQL

DevReach: Creating Xamarin.Forms UIs in C#
DevReach: Creating Xamarin.Forms UIs in C#DevReach: Creating Xamarin.Forms UIs in C#
DevReach: Creating Xamarin.Forms UIs in C#
Brandon Minnick, MBA
 

Similar to Xamarin + GraphQL (20)

Building GraphQL API in C#.pptx
Building GraphQL API in C#.pptxBuilding GraphQL API in C#.pptx
Building GraphQL API in C#.pptx
 
Building GraphQL API in C#.pptx
Building GraphQL API in C#.pptxBuilding GraphQL API in C#.pptx
Building GraphQL API in C#.pptx
 
Xamarin + GraphQL
Xamarin + GraphQLXamarin + GraphQL
Xamarin + GraphQL
 
Xamarin + GraphQL
Xamarin + GraphQLXamarin + GraphQL
Xamarin + GraphQL
 
Apollo GraphQL Workshop
Apollo GraphQL WorkshopApollo GraphQL Workshop
Apollo GraphQL Workshop
 
Building GraphQL APIs in C#.pptx
Building GraphQL APIs in C#.pptxBuilding GraphQL APIs in C#.pptx
Building GraphQL APIs in C#.pptx
 
Consuming GraphQL APIs in C#.pptx
Consuming GraphQL APIs in C#.pptxConsuming GraphQL APIs in C#.pptx
Consuming GraphQL APIs in C#.pptx
 
Building GraphQL APIs in C#.pptx
Building GraphQL APIs in C#.pptxBuilding GraphQL APIs in C#.pptx
Building GraphQL APIs in C#.pptx
 
apidays New York 2022 - Building the Fabric to Future-Proof Modern API Archit...
apidays New York 2022 - Building the Fabric to Future-Proof Modern API Archit...apidays New York 2022 - Building the Fabric to Future-Proof Modern API Archit...
apidays New York 2022 - Building the Fabric to Future-Proof Modern API Archit...
 
GraphQL with .NET Core
GraphQL with .NET CoreGraphQL with .NET Core
GraphQL with .NET Core
 
The .NET MAUI Community Toolkits.pptx
The .NET MAUI Community Toolkits.pptxThe .NET MAUI Community Toolkits.pptx
The .NET MAUI Community Toolkits.pptx
 
DevReach: Creating Xamarin.Forms UIs in C#
DevReach: Creating Xamarin.Forms UIs in C#DevReach: Creating Xamarin.Forms UIs in C#
DevReach: Creating Xamarin.Forms UIs in C#
 
Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptx
 
Creating iOS & Android Apps in C# using Xamarin
Creating iOS & Android Apps in C# using XamarinCreating iOS & Android Apps in C# using Xamarin
Creating iOS & Android Apps in C# using Xamarin
 
Creating iOS & Android Apps in C# using Xamarin
Creating iOS & Android Apps in C# using XamarinCreating iOS & Android Apps in C# using Xamarin
Creating iOS & Android Apps in C# using Xamarin
 
Creating Native iOS & Android Apps in C#
Creating Native iOS & Android Apps in C#Creating Native iOS & Android Apps in C#
Creating Native iOS & Android Apps in C#
 
Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1
 
DevOps Fest 2019. Gianluca Arbezzano. DevOps never sleeps. What we learned fr...
DevOps Fest 2019. Gianluca Arbezzano. DevOps never sleeps. What we learned fr...DevOps Fest 2019. Gianluca Arbezzano. DevOps never sleeps. What we learned fr...
DevOps Fest 2019. Gianluca Arbezzano. DevOps never sleeps. What we learned fr...
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to Xamarin
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 

More from Brandon Minnick, MBA

More from Brandon Minnick, MBA (18)

Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptx
 
Correcting Common Mistakes, AsyncAwait.pptx
Correcting Common Mistakes, AsyncAwait.pptxCorrecting Common Mistakes, AsyncAwait.pptx
Correcting Common Mistakes, AsyncAwait.pptx
 
Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptx
 
Correcting Common Async Await Mistakes in .NET
Correcting Common Async Await Mistakes in .NET Correcting Common Async Await Mistakes in .NET
Correcting Common Async Await Mistakes in .NET
 
AWS Toolkit.pptx
AWS Toolkit.pptxAWS Toolkit.pptx
AWS Toolkit.pptx
 
Building MAUI UIs in C#.pptx
Building MAUI UIs in C#.pptxBuilding MAUI UIs in C#.pptx
Building MAUI UIs in C#.pptx
 
Creating Apps with .NET MAUI.pptx
Creating Apps with .NET MAUI.pptxCreating Apps with .NET MAUI.pptx
Creating Apps with .NET MAUI.pptx
 
Correcting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptxCorrecting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptx
 
Introducing .NET MAUI Toolkit.pptx
Introducing .NET MAUI Toolkit.pptxIntroducing .NET MAUI Toolkit.pptx
Introducing .NET MAUI Toolkit.pptx
 
Building MAUI UI in C#.pptx
Building MAUI UI in C#.pptxBuilding MAUI UI in C#.pptx
Building MAUI UI in C#.pptx
 
Creating Apps with .NET MAUI
Creating Apps with .NET MAUICreating Apps with .NET MAUI
Creating Apps with .NET MAUI
 
Creating Apps With .NET MAUI for iOS, Android, macOS + Windows
Creating AppsWith .NET MAUIfor iOS, Android, macOS + WindowsCreating AppsWith .NET MAUIfor iOS, Android, macOS + Windows
Creating Apps With .NET MAUI for iOS, Android, macOS + Windows
 
The Future of Xamarin
The Future of XamarinThe Future of Xamarin
The Future of Xamarin
 
The Future of Xamarin
The Future of XamarinThe Future of Xamarin
The Future of Xamarin
 
Creating Serverless Apps without Writing Any Code
Creating Serverless Apps without Writing Any CodeCreating Serverless Apps without Writing Any Code
Creating Serverless Apps without Writing Any Code
 
The Future of Xamarin
The Future of XamarinThe Future of Xamarin
The Future of Xamarin
 
Choosing the Best Mobile App Framework
Choosing the Best Mobile App FrameworkChoosing the Best Mobile App Framework
Choosing the Best Mobile App Framework
 
The Future of Xamarin
The Future of XamarinThe Future of Xamarin
The Future of Xamarin
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Editor's Notes

  1. using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using GraphQL.Client; using GraphQL.Client.Http; using GraphQL.Common.Request; using GraphQL.Common.Response; using Newtonsoft.Json; using Xamarin.Forms; namespace XamarinGraphQL { // Learn more about making custom code visible in the Xamarin.Forms previewer // by visiting https://aka.ms/xamarinforms-previewer [DesignTimeVisible(false)] public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); } protected override async void OnAppearing() { base.OnAppearing(); ResponseLabel.Text = "Retrieving Data..."; var client = new HttpClient(); client.DefaultRequestHeaders.Add("User-Agent", nameof(XamarinGraphQL)); client.DefaultRequestHeaders.Add("Authorization", "bearer ceeddf326115d5f094526b7f29fe980e565e497d"); var stringContent = new StringContent("{ \"query\":\"query{ user(login: brminnick) { bio, company, createdAt }}\"}"); var response = await client.PostAsync("https://api.github.com/graphql", stringContent); var json = await response.Content.ReadAsStringAsync(); var userResponse = JsonConvert.DeserializeObject<UserResponse>(json); ResponseLabel.Text = userResponse.Data.User.Bio; } } } -------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using GraphQL.Client; using GraphQL.Client.Http; using GraphQL.Common.Request; using GraphQL.Common.Response; using ModernHttpClient; using Newtonsoft.Json; using Xamarin.Forms; namespace XamarinGraphQL { // Learn more about making custom code visible in the Xamarin.Forms previewer // by visiting https://aka.ms/xamarinforms-previewer [DesignTimeVisible(false)] public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); } protected override async void OnAppearing() { base.OnAppearing(); ResponseLabel.Text = "Retrieving Data..."; var options = new GraphQLHttpClientOptions { EndPoint = new Uri("https://api.github.com/graphql"), HttpMessageHandler = new NativeMessageHandler() }; var client = new GraphQLHttpClient(options); client.DefaultRequestHeaders.Add("User-Agent", nameof(XamarinGraphQL)); client.DefaultRequestHeaders.Add("Authorization", "bearer ceeddf326115d5f094526b7f29fe980e565e497d"); GraphQLResponse response = await client.SendQueryAsync(new GraphQLRequest { Query = "query{ user(login: brminnick) { bio, company, createdAt }}" }); var bio = response.Data.user.bio; var company = response.GetDataFieldAs<User>("user").Company; var createdAt = response.GetDataFieldAs<User>(nameof(User).ToLower()).CreatedAt; ResponseLabel.Text = $"createdAt: {createdAt}\n\nbio: {bio}\n\ncompany: {company}"; } } }