Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
prisma1
Discontinued 💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
-
PostgreSQL
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch
GrahpQL is an open standard (similar to HTML). It is therefore not locked to any specific tool, library or platform. This means that we are able to use GraphQL directly with the native JavaScript fetch API, or even with a light-weight AJAX library like Axios. In the example below, we will establish what the 'Hello World' equivalent of GraphQL in JavaScript would be. In other words:
Most GraphQL endpoints come with some form of GraphQL explorer, the most popular being GraphiQL and GraphQL Playground. As an example, let's start with a public GraphQL endpoint provided by the event management platform Universe.com. Their endpoint allows developers to retrieve data associated with specific events in their database. We can use their explorer to create and test a super basic query.
Next, we'll want to create our own endpoint, since being restricted to data from Universe.com is limiting. There are several server-side GraphQL frameworks. Some extremely popular examples are express-graphql for Node (running Express) and Graphene for Python servers. Alternatively, there are several all-in-one solutions like Prisma or Hasura that come with databases included.
Because of this limited scope, DSLs are often embedded inside other languages as they often need to piggyback on the larger functionality provided by general-purpose languages. However, this does not mean that DSLs are tied to specific languages. For example, SQL (Structured Query Language) is another domain-specific language that is used to query database structures like MySQL or Postgres. Yet, SQL has the same exact syntax whether embedded inside JavaScript, Python or PHP.
GraphQL can be used to express almost any type of data request. As an example, the immensely popular Gatsby React framework uses GraphQL to query frontmatter and plain text inside Markdown files. Yet, in the majority of cases, GraphQL is used as an alternative to a traditional REST (Representational State Transfer) approach.
This means that even if you are already familiar with GraphQL but have only experienced it through libraries like Apollo or Relay, you will find value by learning how to make use of GraphQL by using the native JavaScript Fetch API.
Related posts
- Cryptoflow: Building a secure and scalable system with Axum and SvelteKit - Part 0
- A Developer's Journal: Simplifying the Twelve-Factor App
- Web Scraping in Node.js Using Axios,Cheerio and Json2csv
- How Do I Style A SVG That Is In A React Component, Using CSS?
- FRONTEND AND BACKEND UNDERSTANDING THE DIFFERENCES