Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Interact with a GraphQL API from a .NET Core Application

When it comes to C#, it’s not too difficult or time-consuming to create or consume RESTful APIs. In fact, I recently published a tutorial that demonstrated how to create a RESTful API with .NET Core using MongoDB as the NoSQL database.

RESTful APIs are great, but what happens when you want to work with GraphQL and query your APIs rather than just consume them?

In this tutorial, we’ll see how to use .NET Core to interact with a GraphQL API. To make things easier, we’ll generate our API with MongoDB App Services.

Read More

Implement Full-Text Search over a GraphQL API in MongoDB Atlas

GraphQL can be an extremely powerful and efficient way to create APIs and MongoDB Realm makes it easy by allowing you to connect your collections to GraphQL schemas without writing a single line of code. I wrote about some of the basics behind configuring MongoDB and Realm for GraphQL in an announcement tutorial a while back.

As you find yourself needing to do more advanced things with GraphQL, you’re going to need to familiarize yourself with custom resolvers. If you can’t map collection fields to a schema from within Realm and you need to write custom logic using a serverless function instead, this is where the custom resolvers come into play. Take the example of needing to use an aggregation pipeline within MongoDB. The complex logic that you add to your aggregation pipeline isn’t something you can map. The good news is that you don’t need to abandon MongoDB Realm for these scenarios, but you can leverage Realm’s custom resolvers instead.

In this tutorial we’re going to see how to create a custom resolver that implements Atlas Search for our GraphQL API using Realm Functions, enabling you to add fast, relevant full-text search to your applications.

Read More

Web Services for the Go Developer, First Edition

I’m pleased to announce that my eBook titled, Web Services for the Go Developer, has been published! This is my second book and was inspired by my previous book with nearly the same name that focused on JavaScript development rather than Go development.

So what is the objective of this book?

It is important for developers to be familiar with web services that follow the GraphQL or REST specification, not only from the perspective of using those web services, but also in designing and developing them. The objective of this book is to teach Go developers, through example, how to do just that.

Read More

Developing A GraphQL API With Node.js And MongoDB

While REST APIs are amongst the most popular when it comes to client consumption, they are not the only way to consume data and they aren’t always the best way. For example, having to deal with many endpoints or endpoints that return massive amounts of data that you don’t need are common. This is where GraphQL comes in.

With GraphQL you can query your API in the same sense that you would query a database. You write a query, define the data you want returned, and you get what you requested. Nothing more, nothing less. I actually had the opportunity to interview the co-creator of GraphQL on my podcast in an episode titled, GraphQL for API Development, and in that episode we discuss GraphQL at a high level.

You might remember that I wrote a tutorial titled, Getting Started with GraphQL Development Using Node.js which focused on mock data and no database. This time around we’re going to take a look at including MongoDB as our NoSQL data layer.

Read More

Query A GraphQL API On Android And iOS With NativeScript And Angular

I’ve recently written several tutorials around GraphQL and there are more to come. However, most of these tutorials, including my eBook and video course, Web Services for the JavaScript Developer, have focused on the backend side of things and less of the frontend side of things. Knowing how to create a GraphQL powered API is great, but what if you need to query it from a client facing application?

In a recent tutorial I demonstrated querying a GraphQL API from a Vue.js web application, but what if we wanted to explore something with an Android or iOS mobile application?

In this tutorial we’re going to see how to create an iOS and Android mobile application using NativeScript and Angular and then query a GraphQL API from that application using numerous methods.

Read More

Query A GraphQL API With Vue.js And Axios

I’ve written quite a bit of content around developing a GraphQL API with various programming technologies such as Node.js, Golang, and Java. Heck, I even wrote an eBook on the subject titled, Web Services for the JavaScript Developer. However, I haven’t really produced any content around interacting with those APIs using modern frameworks and client facing technologies, only cURL and Postman.

So how do you interact with a GraphQL API using something like Angular, React, or Vue.js?

There are a lot of frameworks to cover, but in this particular tutorial we’re going to see how to use Vue.js and simple JavaScript to interact with a GraphQL API.

Read More

Use The ChromeiQL Extension For Google Chrome To Test GraphQL Queries

As you probably know, I’ve been doing a lot with GraphQL recently. I’ve released tutorials that include Java with GraphQL, Node.js with GraphQL, as well as Golang with GraphQL, but I’ve only ever demonstrated testing those GraphQL APIs with cURL. If you’ve ever used cURL for anything, not specific to GraphQL, you’ll know it works well, but it isn’t the most friendly tool available.

We’re going to look at an alternative method to testing GraphQL queries using a convenient Google Chrome extension called ChromeiQL.

Read More