#graphql relay client
Explore tagged Tumblr posts
Video
youtube
GraphQL Client Tutorial with Examples for API Developers | #graphql Full Video Link - https://youtube.com/shorts/eIqzlKM6mjoHi, a new #video on #graphql #client #tutorial published on #codeonedigest #youtube channel. @java @awscloud @AWSCloudIndia @YouTube #youtube @codeonedigest #codeonedigest #graphql #graphql #graphqltutorial #whatisgraphql #graphqlapi #graphqlclient #graphqlapolloclient #graphqlapolloclienttutorial #graphqlapolloclientexample #graphqlapolloclientjava #graphqlapolloclientreact #apolloclientgraphqlreactnative #apolloclientrelay #graphqlrelay #graphqlclientapollo #graphqljavaclientexample #graphqlclienttutorial #graphqlclientpostman #graphqlexampletutorial #graphqldeveloper #graphqlclientside #graphqlclientexample
#youtube#graphql client#graphql apollo client#graphql relay client#graphql server#graphql api#graphql#graphql schema#graphql resolver#graphql queries
1 note
·
View note
Text
Understanding and Implementing GraphQL in Mobile Apps
In the dynamic world of mobile app development, integrating robust and efficient APIs is crucial. GraphQL, an open-source data query language developed by Facebook, has emerged as a powerful tool for developers. Unlike traditional REST APIs, GraphQL allows clients to request exactly the data they need, minimizing over-fetching and under-fetching of data. If you're looking to enhance your mobile app development, especially if you're a mobile app development company in Chennai, understanding and implementing GraphQL can provide significant advantages.
Why Choose GraphQL for Mobile Apps
GraphQL’s query language enables clients to fetch only the necessary data, reducing the amount of data transferred over the network. This efficiency is especially beneficial for mobile apps, which often operate on limited bandwidth.
Enhanced Performance
By avoiding multiple round trips to the server, GraphQL improves the performance of your mobile apps. The single request and response structure streamlines data retrieval, enhancing user experience with faster load times.
Strongly Typed Schema
GraphQL uses a strongly typed schema, which helps in defining the structure of the data queries and responses. This schema ensures that both the client and server understand the data format, reducing errors and increasing reliability.
Implementing GraphQL in Mobile Apps
Set Up the Server: Install a GraphQL server. You can use popular libraries like Apollo Server or Express-GraphQL.
Define the Schema: Create your schema by defining the types and the queries your app will support.
Resolvers: Implement resolver functions for your queries to fetch the necessary data from your database or other APIs.
Client Integration: Use a GraphQL client, such as Apollo Client or Relay, to connect your mobile app to the GraphQL server.
Practical Steps
Start by setting up a GraphQL server using tools like Apollo Server or Express-GraphQL. These libraries provide the essential infrastructure for handling GraphQL queries and mutations.
Step 2: Define Your Schema
Define the schema for your API. The schema outlines the types of data and the queries and mutations that your clients can perform. This step is crucial for setting the foundation of your GraphQL implementation.
Step 3: Create Resolvers
Resolvers are functions that handle the data fetching for your queries and mutations. Implement these resolvers to connect your schema to your data sources, whether it's a database, REST API, or other services.
Step 4: Integrate the Client
Finally, integrate a GraphQL client into your mobile app. Apollo Client and Relay are popular choices that provide powerful tools for managing GraphQL queries and state in your app.
Advantages of Using GraphQL
GraphQL simplifies data management by allowing clients to request exactly what they need. This capability reduces the complexity of handling multiple endpoints, making it easier to manage and scale your API.
Real-Time Data with Subscriptions
GraphQL supports real-time data through subscriptions. Subscriptions enable clients to receive updates whenever specific data changes, which is particularly useful for features like notifications or live updates in your mobile app.
Increased Developer Productivity
GraphQL enhances developer productivity by providing a more flexible and efficient way to interact with APIs. The strongly typed schema and powerful query language enable faster development cycles and easier debugging.
Key Considerations
Implement proper security measures when using GraphQL. Ensure that your queries and mutations are properly authenticated and authorized to prevent unauthorized access to sensitive data.
Performance Optimization
Optimize your GraphQL server for performance. Implement caching strategies and use batching techniques to minimize the load on your server and improve response times.
Understanding and implementing GraphQL in mobile apps can significantly enhance the efficiency and performance of your applications. Whether you're a mobile app development company in Chennai or a solo developer, leveraging GraphQL can streamline your data fetching processes and provide a better user experience. For professional assistance in implementing GraphQL and developing high-performance mobile apps, contact Creatah today. Let us help you take your mobile app to the next level!
Contact Creatah now to get started on your next mobile app project!
0 notes
Link
0 notes
Text
Announcing the Relay VSCode extension | by Coinbase | Jun, 2022
Announcing the Relay VSCode extension | by Coinbase | Jun, 2022
Tl;dr: Coinbase is introducing its innovative VSCode extension created in collaboration with the Relay team, for the Relay GraphQL client, which is available for developer use now. By Terence Bezman, Coinbase Senior Software Engineer In collaboration with the Relay team at Meta, Coinbase has built a VSCode extension to integrate with the Relay language server which is now available for developer…
View On WordPress
0 notes
Text
Announcing the Relay VSCode extension | by Coinbase | Jun, 2022
Announcing the Relay VSCode extension | by Coinbase | Jun, 2022
Tl;dr: Coinbase is introducing its innovative VSCode extension created in collaboration with the Relay team, for the Relay GraphQL client, which is available for developer use now. By Terence Bezman, Coinbase Senior Software Engineer In collaboration with the Relay team at Meta, Coinbase has built a VSCode extension to integrate with the Relay language server which is now available for developer��
View On WordPress
0 notes
Text
The Strength and Beauty of GraphQL in Use
The Strength and Beauty of GraphQL in Use
Facebook developed GraphQL as a major problem-solver for more efficient mobile data loading in 2012 and released it as an open-source solution three years later. Since that time, it mistakenly associates with PHP only and lacks trust given the Facebook's reputation (if you know what I mean). However, a recent Netflix case that finds GraphQL as a game-changer to power the API layer and increase the scalability and operability of the studio ecosystem attracts attention. This specification already gained popularity — given State of JavaScript 2019 Report, 50.6% of respondents have heard of GraphQL and would like to learn it. However, The New York Times, Airbnb, Atlassian, Coursera, NBC, GitHub, Shopify, and Starbucks are already among the GraphQL users. We decided to dwell on the beauty, strength, and some constructions of GraphQL in its scalability, performance, and security aspects and tell about our use cases for a banking sphere and a platform of commercial targeting. See the list of useful toolkits added in the end as a bonus.
GraphQL: the Beans Spilled
GraphQL is a convenient way of communication between a client and a server first. Sometimes one can see it as an opponent to REST API given the main difference that GraphQL brings to the table — only endpoint to fetch the data by one call from multiple sources. Meanwhile, we are to provide the space for consideration whether this specification is relevant to particular tasks or REST API is the silver bullet for your case.
Both REST and GraphQL APIs are stateless, supported by any server-side language and any frontend framework, exchange the data through the JSON. But the one and the only endpoint containing the query expression to define the data that should be returned creates the what-you-see-is-what-you-get principle to optimize the work. Let's deep dive into the specification's main advantages and disadvantages.
Performance and Security
The flexibility of GraphQL is its main advantage over REST, as one gets what they want in a single API request. Define the structure of the information to receive back, and it goes back in the format requested, no under-fetching or over-fetching.
Meanwhile, caching seems to be one of the GraphQL downsides compared to REST (see the complete list of all the pros and cons further). REST APIs use the HTTP caching mechanism, providing cached data faster. It leverages its community-powered and time-tested feature, leaving GraphQL behind at the moment.
Security is another area of improvement for GraphQL while comparing it with REST, which boasts of a more mature system. The latter leverages HTTP authentication, JSON Web Tokens (JWT), or OAUth 2.0 mechanisms.
Pros and Cons: All Things Considered
Unlike REST API, GraphQL has detailed documentation and supports the function of nested queries that contributes to the principle "no over fetching and under fetching data," which happened while using the first specification. Query and mutation are the joint GraphQL operations. Thus, the CRUD (create, read, update, delete) model is not relevant for GraphQL as the create operation executes through the query command (other ones are implemented with mutations).
Advantages
Less miscommunication between the server and the client.
Introspection-driven tool: one can request a list of data types available.
Subscriptions — solution to receive real-time messages from the server (as well as detailed error messages).
Fragments enable the function of code-sharing.
No versioning as the GraphQL gives access to the app to get the latest updates.
Disadvantages
It is not the best option for simple apps; REST copes with this task much better.
One endpoint causes the web caching complexity that needs extra solutions for GraphQL specification — it lacks the automatic caching mechanism.
No file uploading, different manipulations required — check if it is critical for your use case.
GraphQL needs time-investment for Schema Definition Language to grasp first — but the fruits of your work will bring benefits afterward.
It is better to avoid too many nested fields at once as it may cause performance issues — define the architecture of the query beforehand.
Our Use Cases with GraphQL
GraphQL provides developers with higher scalability of the system that applies in any sphere. We want to share our experience of functions diversification for a commercial targeting platform and solving the banking application's two-fold task.
The Platform for a Commercial Targeting
GraphQL became a convenient solution for one of our clients who needed to develop a platform for commercial targeting, providing a straightforward approach for searching the potential customers in any national institution or facility. Using it, the client can direct the ads straight to the audience of interest using geolocation data and a set of filters. The platform consists of two primary services: one for geo-based consumers extraction based on PlaceIQ dataset usage and one for attribute-based (consumers identity graph) with consumer dataset. The project can be extended by adding the missing residential dataset to retrieve residents at requested addresses. Also, the services could be wrapped into the REST API to provide the ability to trigger them using web requests.
Risk Reduction and Resilience Boosting Financial Platform
An average bank encounters no more than 100K transactions a day. Moreover, it also faces malicious actions and the risk of cyberattack. One of our clients needed to empower their software platform to encounter higher transaction pressure and provide a higher risk-management system to avoid financial crimes. As a result, we have developed a solution that stands for the high amount of transactions and provides the reports while detecting anomalies based on the transactions' data in real-time.
GraphQL: Useful Toolkit
Check out the growing GraphQL community to find the latest updates on this solution. There are many horizontally and vertically developed solutions for GraphQL client, GraphQL gateway, GraphQL server, and database-to-GraphQL server. Add some of the tools that you enjoy using while working with GraphQL in comments to this blog.
GraphQL's servers are available for languages like JavaScript, Java, Python, Perl, Ruby, C#, Go, etc.
Apollo Server for JavaScript applications and GraphQL Ruby are some of the most popular choices.
Apollo Client, DataLoader, GraphQL Request, and Relay are among popular GraphQL clients. Graphiql, GraphQL IDE, and GraphQL Playground for IDE's respectively.
Some handy tools:
GraphQL Bindings — to use GraphQL API's as modular buildings blocks
GraphQL Docs — to generate GraphQL documentation in a simple way
GraphCMS — GraphQL-based CMS
GraphQL Network for easy debugging
GraphQL Voyager — to visualize data relations
and there are much more, depending on one's needs, as lists are keeping growing. Mention in the comments tools that worth it!
0 notes
Text
How to build DApp with Cosmos SDK?
Why TruStory chose to build on the Cosmos SDK and an overview of its architecture Binance Initial author: Shane Vitarana Original link:

Why choose Cosmos SDK? ** 01_**_ TruStory starts because they build a distributed app whose appearance and experience are the same as normal apps that people are accustomed to. We don't would like users to wait for confirmation whenever they perform an operation, and we don't want customers to have to deal with outstanding transactions (). The App also calls numerous fine-grained dealings, which are all based on activities triggered at a specific time. Therefore we soon found that this cannot be accomplished on the Ethereum mainnet. We need something more delicate and robust. So we believe that sidechains based on Ethereum may be effective. We built an early on prototype on the Loom SDK (), however the framework had not been mature sufficiently to meet up our requirements at that time. Nevertheless, we like Tendermint (), that is a BFT consensus middleware, which can empower Loom. It has quick finality (about 5 seconds), which is essential for the user connection with frequently interacting social apps. Next, we made a decision to attempt the Cosmos SDK () since it was developed simply by the Tendermint team. We have been pleased to find that it gets the following good characteristics: * Statically typed compiled programming language (GO) * Well-built blockchain framework * Modular architecture * Highly configurable * Built-in governance Another thing we learned on Cosmos may be the ability to build a community of stakeholders around the network. We think that the future network can be more equivalent, giving customers and stakeholders even more control and ownership of the system. For example, companies like Airbnb will demand the united states Securities and Swap Commission () to change the guidelines to permit landlords to carry shares in the business. Compared with traditional companies (), social networks later on will tend to be more like cooperative enterprises. Users and stakeholders will be able to serve as customers of services, network operators (verifiers) or even both, and participate in network procedures pretty much according to their wishes. Furthermore, token holders will be able to delegate their tokens to validators and passively take part in the network. Development in line with the Cosmos SDK can provide us with organic technical features to understand user ownership and governance. Customers and validators can vote on upgrades and brand-new features, and assist maintain the values ??and suggestions of the network and user local community (). Users are encouraged to become good citizens and assist coordinate on the network. We've seen effective blockchain governance on Cosmos Hub (), the first network based on the SDK mainnet. (Translator's Take note: The first network based on the SDK mainnet in the Cosmos ecosystem ought to be IRIS Hub) Up to now, virtually all proposals () have significantly more than 60% of the votes. Establishing a self-sustaining and self-governing network can solve many problems of current social networks. It's no magic formula that Facebook offers issues with content material censorship () and personal privacy.

Staking is DeFi** 02_**_ TruStory's incentive mechanism is based on displaying content through pledges. Staking on content could be thought of as an development like the Facebook like key. Likes are a good signal of issue, but they do not offer any form of reward for users to invest time making content. TruStory customers pledge user-created content, which is similar to validators pledge ATOM () for benefit sharing while also safeguarding the Cosmos Hub. In this process, users earn interest in the proper execution of TRU (TruStory's native token). Zaki Manian at the cross-chain conference Without punishment, the incentive mechanism is incomplete. This content of TruStory is adjusted by users who've obtained sufficiently TRU. Users could be fined for bad behavior, and they'll be imprisoned for a period of time. Users who are imprisoned will lose some TRU as punishment. TruStory also programs to put into action staking with the infrastructure level. Put simply, super customers can operate nodes of the TruStory blockchain, also called validators. The validator is responsible for safeguarding the TruStory blockchain by signing transactions and submitting blocks in the PoS system. Similar to TruStory customers, validators pledge TRUs and you will be greatly fined for poor behaviors such as for example offline and double signing. TruStory architecture overview** 03_**_ The first version of TruStory () was a Schelling Point game ((game_theory)) predicated on confirmation and verification of content, but it has recently been transformed right into a platform for more constructive debate around ideas. The Cosmos SDK played a significant role in this turning point (), enabling us to fork our blockchain while migrating all data to the new chain. Each Cosmos chain is guided by a genesis document (#what-is-a-genesis-document) that defines the original state of the blockchain. To fork the blockchain, you may use the order line device that exports the current App condition to produce a fresh genesis file. Make use of any device that can take up a fresh chain to update the genesis file, and then it is possible to migrate. This process is similar to the common database migration () in iterative growth, which brings a far more flexible method of blockchain development. This is a high-level view of TruStory's basic architecture: TruStory architecture The TruChain Area contains a set of validators running the TruStory blockchain node (TruChain). TruChain is really a part built with the Cosmos SDK and implemented in Go. TruAPI is also written in Go and is a GraphQL lighting client responsible for querying and broadcasting dealings to the chain. In addition, it communicates with the Postgres data source to acquire client-specific information that will not have to be on-chain, including information that has nothing related to TRU ideals, such as for example chat logs and consumer configuration documents. GraphQL enables internet and mobile clients to execute information queries from the smooth merge of two chains and databases.

The native mobile client and web client are written in React Native () and React Native for Web respectively. This allows high-level code sharing between local cellular devices (iOS and Google android) and the web. They are connected to the chain via TruAPI. Some microservices can also enable TruStory, such as for example pushing notification services by observing Tendermint events. Push notifications can be extremely powerful when coupled with governance, because users can directly receive notifications of new suggestions and get reminders to vote. TruChain nodes are designed around several core custom modules: * claim * staking [1] * slashing [1] * bank [1] The opinion module is principally for users to store opinion data. It includes the content material of all views and high-level metadata for every view. This is an example of TruStory's take on man-made climate shift: The staking module provides all functions related to staking parameters. A good feature of the Cosmos SDK is that we now have block-level activities that work before and after each block is prepared. After every block, we check the expired pledges and distribute benefits. The penalty and confiscation module punishes bad behavior in the App and rewards users for spontaneous review of bad content. For instance, if an argument will be rejected by way of a certain amount of customers, the pledge tokens of the creators and supporters of the argument will undoubtedly be fined. This can help to maintain an incentive mechanism to help keep the city running. THE LENDER module tracks the supply of tokens and all transactions of users. It mainly works with the wallet function of the App. Each TruChain node also offers a CLI and REST interface, that your validator use to pledge at the network levels. To learn concerning the tools to generate the template files required for custom made modules, please check the Cosmos Module Generator: In the event you develop on top of Cosmos? ** 04_**_ As a fan of distributed technology, I am very worked up about Ethereum 2.0. Nonetheless it is still under advancement, and it will take at least per year to be ready. However, the Cosmos Hub () was launched in March 2019, and there are multiple projects running testnets. After IBC (Inter-Blockchain Conversation Process:) is implemented, Cosmos chains like TruChain will be able to speak to the Cosmos Hub and finally transfer property between Bitcoin and Ethereum through peg area (). Most distributed applications do not require thousands of PoW Ethereum nodes to make sure security. A PoS part chain or custom made blockchain guarded by hundreds or even dozens of nodes is enough. As an additional benefit, you can create a governance framework that meets the needs of one's App, and handle forks, upgrades, and decisions related to the continuing future of the network in a far more structured way. Cosmos SDK is among the best choices. However, building a community of validators and running a sovereign chain may not suit the needs of each project. Some people may decide to purchase an existing validator set and the protection it provides. For instance, Parity's Polkadot () is made around a shared safety model, where each chain is linked to a relay chain and inherits its protection. Although Cosmos currently relies on each chain to provide its security, there are plans to provide shared security in the future (). Another benefit of the customized Cosmos chain is normally that there is you don't need to pay gas fees inside platform tokens (such as for example Ethereum's ETH). These gas fees generally flow to events that have nothing to do with your App or project. Cosmos allows fuel to be compensated in App's indigenous tokens and enables validators to control the charges they would like to charge. For more details on how Cosmos functions, please see Preethi Kasireddy's two-part series: Part 1: So how exactly does Cosmos function, and so how exactly does it change from Bitcoin and Ethereum? the next part: ?? Sign up for the TruStory beta through beta.trustory.io (). Please keep tuned in for the launch of our public testnet [1] The staking, slashing and bank modules of TruStory will vary from the Cosmos SDK modules of the same name.

0 notes
Text
7 Node.JS Trends That Will Dominate in 2020
The new-age software development industry seems to be highly influenced with the in-hype JavaScript and the AI language.
As per the Gartner report 2019, the total global spending upon IT sector is expected to cross by $3.8 trillion with a 3.2% increment in expenditure as compared to the previous year.
In such a scenario, the demand for full stack developers will remain higher not only in the upcoming years but also with the greater number of years to come. And, Node.js is one such combination of tools, libraries and helpers that aids you to create and operate great web applications. It gives your platform a strong base to build a futuristic web platform and thus safeguard your online presence.
Witnessing such continuous and drastic growth in the ecommerce development company, a number of Node.js based apps is expected to rule over the year 2020.
With this continued success, let’s watch out what Node.js trends will dominate in the year 2020.
Upcoming Node.js trends to dominate 2020
Trend #1 Mean and Mern Stack to build complex apps
Both MEAN and MERN (MongoDB, Express, React, Node.JS) are the most powerful and fastest-growing open-source development frameworks that help developers to build the most complex web and mobile screens at the respective platforms. Big-lead tech companies such as Netflix allow developers to make use of MERN stack for a smoother and flexible web development process.
Below is how the technology stack of Netflix works:
Trend #2 Serverless Architecture
One of the major Node.js benefits is that it eliminates the need of factors like server and hardware maintenance that acts as a deciding factor for application performance. Yes, you heard it right!
The next Node.js trend for 2020 is serverless architecture that is already being used by some of the leading production and communication companies such as Netflix, Telenor, Reuters etc.
The industry-wide adoption is constantly growing up at a huge scale because going serverless means there’s no need to take care of the servers running in the applications. With serverless architecture, there is no need to take care of server maintenance since everything is outsourced. This not only saves Node.js development company time and efforts but also reduces the cost to a greater extent.
Such emerging trend gives business a reason to build serverless architecture to stay adhered and compliant.
Let’s checkout what benefits a Node.js with serverless solution can offer to the business:
It reduces development and project cost
It improves code quality
Increases project flexibility
Reusable code modules.
Trend #3 Microservices
The next emerging trend is microservices which is an architectural approach to build an app that collects small services in a package. Apart from being an alternative to the serverless approach, it helps in maintaining application code. So, if you are an ecommerce development company that is projected to launch a big project in the upcoming year, Node.js is highly suitable since it eliminates the need to outsource server maintenance and thus ensures scalability, independent development and reusability.
Trend #4 Real-time mobile app development
Building real-time application is one of the most important use-cases to hire node.js developer in 2020 and beyond. Right from the food delivery app to the most coveted meal app (Zomato) till Google docs and other online collaborations, all these applications require strong backed support and Node.js is a great solution to suffice the needs. Such applications with real-time features and functionalities not only boosts user engagement but also empowers more traffic and sales to your business.
Platforms like live chat, social media, gaming apps, ad servers or stock exchange where speed is the most essential aspect, Node.js can be used to serve thousands of such intensive device in quick and abrupt manner. However, in real-time applications, the risk of overloading server is extremely high but Node.js makes it quite seamless and updated and big thanks to its Events API and Web Sockets.
Trello is one of the leading examples of a web-app where a real-time collaboration is implemented.
Let’s have a glance over some of the real-time examples that can be built with Node.js
Chatting Applications
Online gaming applications
Instant messaging applications like WhatsApp, Vibe
Voice over Internet Protocol
Online Document sharing App
Stockbroking and e-commerce powered app.
If building a scalable, fast yet secured real-time application is the need of an hour, Node.js is the ultimate choice.
Trend #5 GraphQL
As per the statistics recorded by Facebook and Shopify, GraphQL is expected to grow much beyond its existing level and will even continue to grow more in 2020 and beyond.
An alternative to Restful API, GraphQL is an application that let client specify what exact data does it needs. It simplifies the workforce to a greater extent since it aggregates data from multiple resources in a convenient manner. It provides a sample placeholder structure while features will remain constant.
One of the reasons behind the GraphQL’s growing popularity is it can be integrated with React using relay framework.
Trent #6 Cloud-oriented solutions
Since hardware dependency is one of the biggest hindrances to build native cloud apps, Node.js eliminates its need and thus it is an excellent fit to build cloud-native apps from scratch.
With such evident benefits, more business and startups and realizing its importance and looking forward to implementing it in the technology in 2020 and beyond.
Trent #7 Internet Of Things (IoT)
In order to build app with geo-distributed capabilities, Node.js is the best-fit and act as a runtime software since it let developers implement real-time capabilities, microservices and data-centric approaches.
Faster execution and real-time data pull out is one of the main advantages to build complex, scalable and efficient applications on Node.js.
Conclusion:
Node.js – The future promising technology of 2020 and beyond!
Node.js plays an essential role in technology stack and offers highly scalable, cheaper, independent services in such a short span of time. These trends will surely play a decisive role in development of on-demand and real-time applications in web market.
Source:
https://www.thinktanker.io/blog/7-node-js-trends-that-will-dominate-in-2020.html
0 notes
Photo
V8 v8, the State of JS survey results, and CDNJS lives
#468 — December 20, 2019
Read on the Web
If you're subscribed to any of our other newsletters, you'll have seen we're doing 2019 roundups this week.. but not in JavaScript Weekly! :-) Our 2019 JavaScript roundup will be here on January 3, but today is a normal issue. Happy holidays!
JavaScript Weekly
Tesseract.js 2.0: Pure JavaScript OCR for 100 Languages — A pure JavaScript port of the popular C++ Tesseract library commonly used for visual text recognition purposes by other systems. The homepage has a neat demo where you can drop on images of your own and see how they get processed. v2.0 is now out and here's why the creator has been working on it.
Jerome Wu
V8 Release v8.0 — Yes, that’s v8 of v8 – not confusing at all 😂 Nonetheless, it’s a key step forward for the most widely deployed JavaScript engine, and introduces optional chaining, nullish coalescing, and some significant performance improvements. It’ll be landing in a Chrome and Node near you soon.
Leszek Swirski
Learn the Full Stack with Jem Young, Senior Software Engineer at Netflix — Become a more well rounded engineer by understanding what is happening on the server-side.
Frontend Masters sponsor
Results from the 'State of JavaScript' 2019 Survey — While the methodology is far from perfect (for example, Angular and Angular.js seem to get lumped together as the same thing), this is nonetheless the biggest JavaScript-specific survey. There’s a lot to dig through, so you may prefer The Changelog's 7 insights from the State of JS 2019 roundup post that looks at the most striking results.
Sacha Greif, Raphaël Benitte and Amelia Wattenberger
An Update on CDNJS — CDNJS is a popular content distribution network for JavaScript files but just a couple of months ago its continued development was in doubt. In this significant update we learn more about how CDNJS works and how Cloudflare want to take it forward (and they need our help).
Zack Bloom
Mastering console.log Like A Pro — This isn’t exactly new ground, but if you’re a heavy console.log user, this article deftly covers a variety of extra console methods to keep on your radar.
Harsh Makadia
⚡️ Quick Releases
Node.js 13.5.0
Material UI 4.8 — Popular React components system.
Relay 8.0 — GraphQL client and integration for React apps.
sql.js 1.1 — SQLite, but compiled to JavaScript.
Cash 5.0 — jQuery-style DOM manipulation for modern browsers.
💻 Jobs
Backend Engineering Position 🤘 in Beautiful Norway 🎉 — Passion for JavaScript, GraphQL, Scalability and Performance? Want to move to Norway? Join our fast growing e-commerce service Crystallize.
Crystallize
Find a Job Through Vettery — Make a profile, name your salary, and connect with hiring managers from top employers. Vettery is completely free for job seekers.
Vettery
Technical Content Producer (Interim) at Ably (London, Remote OK) — Ably builds tools and cloud infrastructure for the realtime internet. They need a developer/tech writer on a temporary basis to coordinate, outsource, and review the creation of technical content for a developer audience.
Ably
📘 Articles & Tutorials
What's Coming in Angular 9.0.0 and Ivy Improvements — Angular 9.0 was due to be released this year but is being held back until next year to give the team a break. Nonetheless, it’s going to pack in some key improvements.
Mike Hartington
An Introduction to Controlling the Raspberry Pi 4's GPIO Pins from Node — If you’ve got a Raspberry Pi sat around (I have a few!) and you’re looking to have a play over the holiday season, you could start here.
Uday Hiwarale
Migrating a Distributed System from JavaScript to TypeScript — Learn how to migrate a globally-distributed system written in JavaScript over to TypeScript.
Ably sponsor
Understanding Decorators in JavaScript — Decorators are a first-class concept in some languages that can be used to quickly modify functions or classes by way of a simple directive. The idea is still merely a proposal for JavaScript, but it’s possible to adapt some of the ideas now with Babel.
Mike Green
A Case for Using void in Modern JavaScript? — Some interesting points here. I doubt they’ll take off, but I like the examples.
slikts
Writing JavaScript With Only Six Characters — A fun article like this tends to do the rounds each year and it never ceases to delight me at how quirky JavaScript can be.
Erik Wendel
Const Assertions in Literal Expressions in TypeScript
Marius Schulz
What’s New in Preact X? — Preact is a lightweight React alternative with React API compatibility.
Ogundipe Samuel
Sentiment Analysis of Your Year with TensorFlow.js — Perform sentiment analysis with TensorFlow in JavaScript to determine the positivity of text messages received via Twilio.
Lizzie Siegle
BDD vs Executable Specifications
Gauge sponsor
▶ The Design Principles of Vue 3.0 — A 50 minute talk from the creator of Vue.js, Evan You, on the principles behind the changes coming in Vue 3.0.
Evan You
10 Useful Angular Features You’ve Probably Never Used — Assuming you actually use Angular in the first place, naturally.
Chidume Nnamdi
Why Svelte Won’t 'Kill' React
Kit Isaev
🔧 Code & Tools
A-Frame 1.0 Released: Framework for Building VR Experiences — A-Frame handles the 3D and WebVR boilerplate required to get running across numerous platforms quickly. Version 1 boasts full WebXR support.
A-Frame Team
Introducing Scully: The Angular Static Site Generator — The Angular community now has their very own static site generator.
Netlify
Polly.js 3.0: Record, Replay, and Stub HTTP Interactions — A library from Netflix for recording, replaying and stubbing HTTP interactions via native browser APIs. GitHub repo.
Netflix
▶ From NodeConf EU: What's Being Built and Where Node.js Is Heading
Heroku sponsor
Sarus: A Client-Side Library for WebSockets — Helps you handle situations where connections unexpectedly close.
Anephenix
Alpine.js: A Minimal Framework for Composing Behavior in Your Markup — “Think of it like Tailwind for JavaScript.”
Alpine.js
vue2-datepicker: A Date / DateTime Picker Component for Vue
xiemengxiong
If you're celebrating, we hope you have a happy holiday season and we'll see you in the new year on January 3, 2020.
by via JavaScript Weekly https://ift.tt/2Z90iZH
0 notes
Text
How To Build A Real-Time App With GraphQL Subscriptions On Postgres
How To Build A Real-Time App With GraphQL Subscriptions On Postgres
Sandip Devarkonda
2018-12-10T14:00:23+01:002018-12-10T13:04:58+00:00
In this article, we’ll take a look at the challenges involved in building real-time applications and how emerging tooling is addressing them with elegant solutions that are easy to reason about. To do this, we’ll build a real-time polling app (like a Twitter poll with real-time overall stats) just by using Postgres, GraphQL, React and no backend code!
The primary focus will be on setting up the backend (deploying the ready-to-use tools, schema modeling), and aspects of frontend integration with GraphQL and less on UI/UX of the frontend (some knowledge of ReactJS will help). The tutorial section will take a paint-by-numbers approach, so we’ll just clone a GitHub repo for the schema modeling, and the UI and tweak it, instead of building the entire app from scratch.
All Things GraphQL
Do you know everything you need to know about GraphQL? If you have your doubts, Eric Baer has you covered with a detailed guide on its origins, its drawbacks and the basics of how to work with it. Read article →
Before you continue reading this article, I’d like to mention that a working knowledge of the following technologies (or substitutes) are beneficial:
ReactJS This can be replaced with any frontend framework, Android or IOS by following the client library documentation.
Postgres You can work with other databases but with different tools, the principles outlined in this post will still apply.
You can also adapt this tutorial context for other real-time apps very easily.
A demonstration of the features in the polling app that we’ll be building. (Large preview)
As illustrated by the accompanying GraphQL payload at the bottom, there are three major features that we need to implement:
Fetch the poll question and a list of options (top left).
Allow a user to vote for a given poll question (the “Vote” button).
Fetch results of the poll in real-time and display them in a bar graph (top right; we can gloss over the feature to fetch a list of currently online users as it’s an exact replica of this use case).
Front-end is messy and complicated these days. That's why we publish articles, printed books and webinars with useful techniques to improve your work. Even better: Smashing Membership with a growing selection of front-end & UX goodies. So you get your work done, better and faster.
Explore Smashing Membership ↬
Challenges With Building Real-Time Apps
Building real-time apps (especially as a frontend developer or someone who’s recently made a transition to becoming a fullstack developer), is a hard engineering problem to solve. This is generally how contemporary real-time apps work (in the context of our example app):
The frontend updates a database with some information; A user’s vote is sent to the backend, i.e. poll/option and user information (user_id, option_id).
The first update triggers another service that aggregates the poll data to render an output that is relayed back to the app in real-time (every time a new vote is cast by anyone; if this done efficiently, only the updated poll’s data is processed and only those clients that have subscribed to this poll are updated):
Vote data is first processed by an register_vote service (assume that some validation happens here) that triggers a poll_results service.
Real-time aggregated poll data is relayed by the poll_results service to the frontend for displaying overall statistics.
A poll app designed traditionally
This model is derived from a traditional API-building approach, and consequently has similar problems:
Any of the sequential steps could go wrong, leaving the UX hanging and affecting other independent operations.
Requires a lot of effort on the API layer as it’s a single point of contact for the frontend app, that interacts with multiple services. It also needs to implement a websockets-based real-time API — there is no universal standard for this and therefore sees limited support for automation in tools.
The frontend app is required to add the necessary plumbing to consume the real-time API and may also have to solve the data consistency problem typically seen in real-time apps (less important in our chosen example, but critical in ordering messages in a real-time chat app).
Many implementations resort to using additional non-relational databases on the server-side (Firebase, etc.) for easy real-time API support.
Let’s take a look at how GraphQL and associated tooling address these challenges.
What Is GraphQL?
GraphQL is a specification for a query language for APIs, and a server-side runtime for executing queries. This specification was developed by Facebook to accelerate app development and provide a standardized, database-agnostic data access format. Any specification-compliant GraphQL server must support the following:
Queries for reads A request type for requesting nested data from a data source (which can be either one or a combination of a database, a REST API or another GraphQL schema/server).
Mutations for writes A request type for writing/relaying data into the aforementioned data sources.
Subscriptions for live-queries A request type for clients to subscribe to real-time updates.
GraphQL also uses a typed schema. The ecosystem has plenty of tools that help you identify errors at dev/compile time which results in fewer runtime bugs.
Here’s why GraphQL is great for real-time apps:
Live-queries (subscriptions) are an implicit part of the GraphQL specification. Any GraphQL system has to have native real-time API capabilities.
A standard spec for real-time queries has consolidated community efforts around client-side tooling, resulting in a very intuitive way of integrating with GraphQL APIs.
GraphQL and a combination of open-source tooling for database events and serverless/cloud functions offer a great substrate for building cloud-native applications with asynchronous business logic and real-time features that are easy to build and manage. This new paradigm also results in great user and developer experience.
In the rest of this article, I will use open-source tools to build an app based on this architecture diagram:
A poll app designed with GraphQL
Building A Real-Time Poll/Voting App
With that introduction to GraphQL, let’s get back to building the polling app as described in the first section.
The three features (or stories highlighted) have been chosen to demonstrate the different GraphQL requests types that our app will make:
Query Fetch the poll question and its options.
Mutation Let a user cast a vote.
Subscription Display a real-time dashboard for poll results.
GraphQL request types in the poll app (Large preview)
Prerequisites
A Heroku account (use the free tier, no credit card required) To deploy a GraphQL backend (see next point below) and a Postgres instance.
Hasura GraphQL Engine (free, open-source)/>A ready-to-use GraphQL server on Postgres.
Apollo Client (free, open-source SDK) For easily integrating clients apps with a GraphQL server.
npm (free, open-source package manager) To run our React app.
Deploying The Database And A GraphQL Backend
We will deploy an instance each of Postgres and GraphQL Engine on Heroku’s free tier. We can use a nifty Heroku button to do this with a single click.
Heroku button
Note: You can also follow this link or search for documentation Hasura GraphQL deployment for Heroku (or other platforms).
Deploying Postgres and GraphQL Engine to Heroku’s free tier (Large preview)
You will not need any additional configuration, and you can just click on the “Deploy app” button. Once the deployment is complete, make a note of the app URL:
<app-name>.herokuapp.com
For example, in the screenshot above, it would be:
hge-realtime-app-tutorial.herokuapp.com
What we’ve done so far is deploy an instance of Postgres (as an add-on in Heroku parlance) and an instance of GraphQL Engine that is configured to use this Postgres instance. As a result of doing so, we now have a ready-to-use GraphQL API but, since we don’t have any tables or data in our database, this is not useful yet. So, let’s address this immediately.
Modeling the database schema
The following schema diagram captures a simple relational database schema for our poll app:
Schema design for the poll app. (Large preview)
As you can see, the schema is a simple, normalized one that leverages foreign-key constraints. It is these constraints that are interpreted by the GraphQL Engine as 1:1 or 1:many relationships (e.g. poll:options is a 1: many relationship since each poll will have more than 1 option that are linked by the foreign key constraint between the id column of the poll table and the poll_id column in the option table). Related data can be modelled as a graph and can thus power a GraphQL API. This is precisely what the GraphQL Engine does.
Based on the above, we’ll have to create the following tables and constraints to model our schema:
Poll A table to capture the poll question.
Option Options for each poll.
Vote To record a user’s vote.
Foreign-key constraint between the following fields (table : column):
option : poll_id → poll : id
vote : poll_id → poll : id
vote : created_by_user_id → user : id
Now that we have our schema design, let’s implement it in our Postgres database. To instantly bring this schema up, here’s what we’ll do:
Download the GraphQL Engine CLI.
Clone this repo:
$ git clone clone https://github.com/hasura/graphql-engine $ cd graphql-engine/community/examples/realtime-poll
Go to hasura/ and edit config.yaml:
endpoint: https://<app-name>.herokuapp.com
Apply the migrations using the CLI, from inside the project directory (that you just downloaded by cloning):
$ hasura migrate apply
That’s it for the backend. You can now open the GraphQL Engine console and check that all the tables are present (the console is available at https://<app-name>.herokuapp.com/console).
Note: You could also have used the console to implement the schema by creating individual tables and then adding constraints using a UI. Using the built-in support for migrations in GraphQL Engine is just a convenient option that was available because our sample repo has migrations for bringing up the required tables and configuring relationships/constraints (this is also highly recommended regardless of whether you are building a hobby project or a production-ready app).
Integrating The Frontend React App With The GraphQL Backend
The frontend in this tutorial is a simple app that shows poll question, the option to vote and the aggregated poll results in one place. As I mentioned earlier, we’ll first focus on running this app so you get the instant gratification of using our recently deployed GraphQL API , see how the GraphQL concepts we looked at earlier in this article power the different use-cases of such an app, and then explore how the GraphQL integration works under the hood.
NOTE: If you are new to ReactJS, you may want to check out some of these articles. We won’t be getting into the details of the React part of the app, and instead, will focus more on the GraphQL aspects of the app. You can refer to the source code in the repo for any details of how the React app has been built.
Configuring The Frontend App
In the repo cloned in the previous section, edit HASURA_GRAPHQL_ENGINE_HOSTNAME in the src/apollo.js file (inside the /community/examples/realtime-poll folder) and set it to the Heroku app URL from above:
export const HASURA_GRAPHQL_ENGINE_HOSTNAME = 'random-string-123.herokuapp.com';
Go to the root of the repository/app-folder (/realtime-poll/) and use npm to install the prequisite modules and then run the app:
$ npm install $ npm start
Screenshot of the live poll app (Large preview)
You should be able to play around with the app now. Go ahead and vote as many times as you want, you’ll notice the results changing in real time. In fact, if you set up another instance of this UI and point it to the same backend, you’ll be able to see results aggregated across all the instances.
So, how does this app use GraphQL? Read on.
Behind The Scenes: GraphQL
In this section, we’ll explore the GraphQL features powering the app, followed by a demonstration of the ease of integration in the next one.
The Poll Component And The Aggregated Results Graph
The poll component on the top left that fetches a poll with all of its options and captures a user’s vote in the database. Both of these operations are done using the GraphQL API. For fetching a poll’s details, we make a query (remember this from the GraphQL introduction?):
query { poll { id question options { id text } } }
Using the Mutation component from react-apollo, we can wire up the mutation to a HTML form such that the mutation is executed using variables optionId and userId when the form is submitted:
mutation vote($optionId: uuid!, $userId: uuid!) { insert_vote(objects: [{option_id: $optionId, created_by_user_id: $userId}]) { returning { id } } }
To show the poll results, we need to derive the count of votes per option from the data in vote table. We can create a Postgres View and track it using GraphQL Engine to make this derived data available over GraphQL.
CREATE VIEW poll_results AS SELECT poll.id AS poll_id, o.option_id, count(*) AS votes FROM (( SELECT vote.option_id, option.poll_id, option.text FROM ( vote LEFT JOIN public.option ON ((option.id = vote.option_id)))) o LEFT JOIN poll ON ((poll.id = o.poll_id))) GROUP BY poll.question, o.option_id, poll.id;
The poll_results view joins data from vote and poll tables to provide an aggregate count of number of votes per each option.
Using GraphQL Subscriptions over this view, react-google-charts and the subscription component from react-apollo, we can wire up a reactive chart which updates in realtime when a new vote happens from any client.
subscription getResult($pollId: uuid!) { poll_results(where: {poll_id: {_eq: $pollId}}) { option { id text } votes } }
GraphQL API Integration
As I mentioned earlier, I used Apollo Client, an open-source SDK to integrate a ReactJS app with the GraphQL backend. Apollo Client is analogous to any HTTP client library like requests for python, the standard http module for JavaScript, and so on. It encapsulates the details of making an HTTP request (in this case POST requests). It uses the configuration (specified in src/apollo.js) to make query/mutation/subscription requests (specified in src/GraphQL.jsx with the option to use variables that can be dynamically substituted in the JavaScript code of your REACT app) to a GraphQL endpoint. It also leverages the typed schema behind the GraphQL endpoint to provide compile/dev time validation for the aforementioned requests. Let’s see just how easy it is for a client app to make a live-query (subscription) request to the GraphQL API.
Configuring The SDK
The Apollo Client SDK needs to be pointed at a GraphQL server, so it can automatically handle the boilerplate code typically needed for such an integration. So, this is exactly what we did when we modified src/apollo.js when setting up the frontend app.
Making A GraphQL Subscription Request (Live-Query)
Define the subscription we looked at in the previous section in the src/GraphQL.jsx file:
const SUBSCRIPTION_RESULT = ` subscription getResult($pollId: uuid!) { poll_results ( order_by: option_id_desc, where: { poll_id: {_eq: $pollId} } ) { option_id option { id text } votes } }`;
We’ll use this definition to wire up our React component:
export const Result = (pollId) => ( <Subscription subscription={gql`${SUBSCRIPTION_RESULT}`} variables={pollId}> {({ loading, error, data }) => { if (loading) return
Loading...</p>; if (error) return
Error :</p>; return ( <div> <div> {renderChart(data)} </div> </div> ); }} </Subscription> )
One thing to note here is that the above subscription could also have been a query. Merely replacing one keyword for another gives us a “live-query”, and that’s all it takes for the Apollo Client SDK to hook this real-time API with your app. Every time there’s a new dataset from our live-query, the SDK triggers a re-render of our chart with this updated data (using the renderChart(data) call). That’s it. It really is that simple!
Final Thoughts
In three simple steps (creating a GraphQL backend, modeling the app schema, and integrating the frontend with the GraphQL API), you can quickly wire-up a fully-functional real-time app, without getting mired in unnecessary details such as setting up a websocket connection. That right there is the power of community tooling backing an abstraction like GraphQL.
If you’ve found this interesting and want to explore GraphQL further for your next side project or production app, here are some factors you may want to use for building your GraphQL toolchain:
Performance & Scalability GraphQL is meant to be consumed directly by frontend apps (it’s no better than an ORM in the backend; real productivity benefits come from doing this). So your tooling needs to be smart about efficiently using database connections and should be able scale effortlessly.
Security It follows from above that a mature role-based access-control system is needed to authorize access to data.
Automation If you are new to the GraphQL ecosystem, handwriting a GraphQL schema and implementing a GraphQL server may seem like daunting tasks. Maximize the automation from your tooling so you can focus on the important stuff like building user-centric frontend features.
Architecture/>As trivial as the above efforts seem like, a production-grade app’s backend architecture may involve advanced GraphQL concepts like schema-stitching, etc. Moreover, the ability to easily generate/consume real-time APIs opens up the possibility of building asynchronous, reactive apps that are resilient and inherently scalable. Therefore, it’s critical to evaluate how GraphQL tooling can streamline your architecture.
Related Resources
You can check out a live version of the app over here.
The complete source code is available on GitHub.
If you’d like to explore the database schema and run test GraphQL queries, you can do so over here.
(rb, ra, yk, il)
0 notes
Text
GraphQL Client Tutorial with Examples for API Developers
Full Video Link - https://youtube.com/shorts/eIqzlKM6mjo Hi, a new #video on #graphql #client #tutorial published on #codeonedigest #youtube channel. @java @awscloud @AWSCloudIndia @YouTube #youtube @codeonedigest #codeonedigest #graphql #graphql
GraphQL Client is the best way to build client applications in Graphql. This client is designed to help developer in building UI quickly that fetches data with GraphQL and can be used with any JavaScript front-end. There are powerful clients available like Apollo Client & Relay which can automatically handle batching, caching, and other features for your client application. GraphQL client also…
View On WordPress
0 notes
Text
Facebook's Relay JavaScript framework gets GraphQL
Facebook’s Relay JavaScript framework gets GraphQL
Facebook has reconstructed its Relay JavaScript framework for building data-driven applications for easier use. Renamed Relay Modern, the updated framework features a GraphQL framework incorporating best practices from classic Relay, Facebook’s native mobile GraphQL clients, and the GraphQL community, Facebook software engineers Lee Byron and Joe Savona said this week. [ Use JavaScript in your…
View On WordPress
0 notes
Text
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching Hey, I’m Jens, founder of WunderGraph. Over the years of working with REST & GraphQL APIs, I found that some aspects of using it are way too complicated. Here’s a list of problems I believe could be abstracted away: – Aggregating multiple GraphQL, REST, etc. APIs into a simple to use API (Backend for Frontend) without writing code – adding Authentication & Authorization to APIs you don’t have full control over – adding efficient and easy to use Caching to GraphQL APIs without writing code – adding persisted queries for security and performance reasons without making my application code and deployment process more complex Companies like Facebook, who are concerned about security and performance, use persisted Queries and don’t expose their GraphQL API directly to the public. While developing they write their Queries using Relay and persist (whitelist) them at compile time. At least that’s my understanding from their blog posts and conference talks. WunderGraph takes this approach to the next level by turning the flow around. Relay, Apollo, URQL, etc. are very complex pieces of software because of the dynamic nature of GraphQL. With WunderGraph we define all Operations in GraphiQL “on the server” and then generate a very simple client from it. In a nutshell, Queries become simple GET requests with variables as query parameters, Mutations still are POST requests but just with variables as the body. A more in depth explanation including an example can be found here: https://www.reddit.com/r/graphql/comments/ijui1x/show_wundergraph_public_beta_aggregate_rest/ More info & docs: https://wundergraph.com/ For those who like to watch videos, here’s a general overview: https://youtu.be/RwkThD5pz1E Here’s a full 26m tutorial with React & Typescript that helps to start from scratch: https://youtu.be/8BQNeeVoFGI August 31, 2020 at 02:06AM
from Blogger http://newcapitalentrepreneur.blogspot.com/2020/08/show-hn-wundergraph-aggregate-rest-and.html via SEO Services
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651 via https://capitalentrepreneur.finance.blog/
0 notes
Text
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651:
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching Hey, I’m Jens, founder of WunderGraph. Over the years of working with REST & GraphQL APIs, I found that some aspects of using it are way too complicated. Here’s a list of problems I believe could be abstracted away: - Aggregating multiple GraphQL, REST, etc. APIs into a simple to use API (Backend for Frontend) without writing code - adding Authentication & Authorization to APIs you don’t have full control over - adding efficient and easy to use Caching to GraphQL APIs without writing code - adding persisted queries for security and performance reasons without making my application code and deployment process more complex Companies like Facebook, who are concerned about security and performance, use persisted Queries and don’t expose their GraphQL API directly to the public. While developing they write their Queries using Relay and persist (whitelist) them at compile time. At least that’s my understanding from their blog posts and conference talks. WunderGraph takes this approach to the next level by turning the flow around. Relay, Apollo, URQL, etc. are very complex pieces of software because of the dynamic nature of GraphQL. With WunderGraph we define all Operations in GraphiQL “on the server” and then generate a very simple client from it. In a nutshell, Queries become simple GET requests with variables as query parameters, Mutations still are POST requests but just with variables as the body. A more in depth explanation including an example can be found here: https://www.reddit.com/r/graphql/comments/ijui1x/show_wundergraph_public_beta_aggregate_rest/ More info & docs: https://wundergraph.com/ For those who like to watch videos, here’s a general overview: https://youtu.be/RwkThD5pz1E Here’s a full 26m tutorial with React & Typescript that helps to start from scratch: https://youtu.be/8BQNeeVoFGI August 31, 2020 at 02:06AM
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651 via https://newcapitalentrepreneur.tumblr.com/
0 notes
Link
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching Hey, I'm Jens, founder of WunderGraph. Over the years of working with REST & GraphQL APIs, I found that some aspects of using it are way too complicated. Here's a list of problems I believe could be abstracted away: - Aggregating multiple GraphQL, REST, etc. APIs into a simple to use API (Backend for Frontend) without writing code - adding Authentication & Authorization to APIs you don't have full control over - adding efficient and easy to use Caching to GraphQL APIs without writing code - adding persisted queries for security and performance reasons without making my application code and deployment process more complex Companies like Facebook, who are concerned about security and performance, use persisted Queries and don't expose their GraphQL API directly to the public. While developing they write their Queries using Relay and persist (whitelist) them at compile time. At least that's my understanding from their blog posts and conference talks. WunderGraph takes this approach to the next level by turning the flow around. Relay, Apollo, URQL, etc. are very complex pieces of software because of the dynamic nature of GraphQL. With WunderGraph we define all Operations in GraphiQL "on the server" and then generate a very simple client from it. In a nutshell, Queries become simple GET requests with variables as query parameters, Mutations still are POST requests but just with variables as the body. A more in depth explanation including an example can be found here: https://www.reddit.com/r/graphql/comments/ijui1x/show_wundergraph_public_beta_aggregate_rest/ More info & docs: https://wundergraph.com/ For those who like to watch videos, here's a general overview: https://youtu.be/RwkThD5pz1E Here's a full 26m tutorial with React & Typescript that helps to start from scratch: https://youtu.be/8BQNeeVoFGI August 31, 2020 at 02:06AM
0 notes
Text
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651
Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching Hey, I'm Jens, founder of WunderGraph. Over the years of working with REST & GraphQL APIs, I found that some aspects of using it are way too complicated. Here's a list of problems I believe could be abstracted away: - Aggregating multiple GraphQL, REST, etc. APIs into a simple to use API (Backend for Frontend) without writing code - adding Authentication & Authorization to APIs you don't have full control over - adding efficient and easy to use Caching to GraphQL APIs without writing code - adding persisted queries for security and performance reasons without making my application code and deployment process more complex Companies like Facebook, who are concerned about security and performance, use persisted Queries and don't expose their GraphQL API directly to the public. While developing they write their Queries using Relay and persist (whitelist) them at compile time. At least that's my understanding from their blog posts and conference talks. WunderGraph takes this approach to the next level by turning the flow around. Relay, Apollo, URQL, etc. are very complex pieces of software because of the dynamic nature of GraphQL. With WunderGraph we define all Operations in GraphiQL "on the server" and then generate a very simple client from it. In a nutshell, Queries become simple GET requests with variables as query parameters, Mutations still are POST requests but just with variables as the body. A more in depth explanation including an example can be found here: https://www.reddit.com/r/graphql/comments/ijui1x/show_wundergraph_public_beta_aggregate_rest/ More info & docs: https://wundergraph.com/ For those who like to watch videos, here's a general overview: https://youtu.be/RwkThD5pz1E Here's a full 26m tutorial with React & Typescript that helps to start from scratch: https://youtu.be/8BQNeeVoFGI August 31, 2020 at 02:06AM Show HN: WunderGraph – Aggregate REST and GraphQL APIs, Add AuthN/Z and Caching https://news.ycombinator.com/item?id=24329651 via https://newcapitalentrepreneur.blogspot.com/
0 notes