Here I have picked one of most interesting topic for API development. From many year, we are developing an API in two Protocols REST and SOAP and most of time developers are preferred REST, because of its simplicity and easy to handle in APPS’. But last many days I have seen a new Query language with more simple and fast as compared to REST and it is graphical query lang.(GraphQL).
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
What Is GraphQL?
GraphQL is an application layer query language that interprets a string by a server, which then returns the required data in a specified format. Open sourced by Facebook in 2015, GraphQL was developed internally during the transition from Facebook’s HTML5-powered mobile apps to native apps. Today it is the principle graph data query language powering the majority of interactions within iOS and Facebook Android applications. Anyone that has used native iOS or Android apps during the past two years has used GraphQL-powered apps.
The creators of GraphQL plan to open-source an instruction program on how to implement the server. The goal is to expand GraphQL capabilities to adapt to a wide range of backends. This will allow coders to use the technology in projects of any size to access their own data more efficiently. Product developers will be able to structure servers and provide powerful frameworks, abstractions and tools.
What You Can Do With GraphQL
GraphQL is a very liberating platform. With GraphQL, product developers no longer need to contend with ad hoc endpoints or worry about accessing data with multiple roundtrip object retrievals. Instead, you can easily create an elegant, declarative-hierarchical query dispatched to one single endpoint. You no longer have to jump back and forth from client to server development environments to test new codes or to create views of data already entered. Now all your experimentation and newly created views are built exclusively in the client development environment. The hassle of moving unstructured data from ad hoc endpoints into business objects is eliminated. Instead, you get a powerful, intuitive type system you can use as a tool-building platform.
How GraphQL Is Different
The GraphQL query language is positioned between client applications and the actual data sources. Think of it as a type of agreement between the client and the server with an efficient query and fetching system. It works independently from data sources and other platforms. A GraphQL server can be created in PHP, Node or any other platform of your choice. People should be able to connect to your GraphQL server with web apps, mobile apps or any other type of apps they may be using. They can then query and mutate the data they are looking for.
It has very interesting feature and I have mentioned the list.
Ask for what you need,
get exactly thatSend a GraphQL query to your API and get exactly what you need, nothing more and nothing less. GraphQL queries always return predictable results. Apps using GraphQL are fast and stable because they control the data they get, not the server.
Get many resources
in a single requestGraphQL queries access not just the properties of one resource but also smoothly follow references between them. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections.
Describe what’s possible
with a type systemGraphQL APIs are organized in terms of types and fields, not endpoints. Access the full capabilities of your data from a single endpoint. GraphQL uses types to ensure Apps only ask for what’s possible and provide clear and helpful errors. Apps can use types to avoid writing manual parsing code.
Evolve your API
without versionsAdd new fields and types to your GraphQL API without impacting existing queries. Aging fields can be deprecated and hidden from tools. By using a single evolving version, GraphQL APIs give apps continuous access to new features and encourage cleaner, more maintainable server code.
Git is a very wonderful and revision management system as we all developer know it. Git has itself an advance level bus architecture. Today Git is very useful for every IT industries they are using it very frequently. But still Git has hold many hidden features, which we have not know yet. So today I am going to share one of them.
It is Upstream and Downstream. Before trying to understand what the upstream tracking branch is, you need to be familiar with remote branches (e.g. origin/master). If you are not, you probably want to read the section about them in the Pro Git book here.
To see all your remote tracking branches, you can use
git branch –remotes
The upstream tracking branch
Even if you have never heard of the concept, you probably already have at least one upstream tracking branch: master -> origin/master. When you clone a repository the current HEAD (usually ‘master’) is checked out for you, but also, it’s setup to track ‘origin/master’, and thus ‘origin/master’ is the “upstream” of ‘master’.
This has some implications on some Git tools, for example, when you run ‘git status‘ you might see a message like this:
# Your branch is behind 'origin/master' by 1 commit.
This is useful in order to keep your local branches synchronized with the remote ones, but it’s only scratching the surface.
A downstream repository (aka a “fork”) maintainer commonly needs to stay current with upstream work. The following steps allow you to achieve this on the command line in a local git repository.
Add the Remote Upstream Repository
This step defines the upstream repository of your fork.
$ git remote add upstream [Upstream git URL]
Fetch the Upstream Branches
$ git fetch upstream
Merge Upstream Changes into your Downstream Repository
From your master branch, use the following merge command to merge the upstream master branch changes into your local source:
$ git merge upstream/master
Create a New Branch for Work
Create a branch off of the master branch that will include the new work. While working in the master branch, execute the following (with any appropriate branch name in quotes):
$ git checkout -b "feature-new-stuff"
Here, we defined the branch feature-new-stuff and will perform work there.
Perform Your Local Work
Follow the standard local repository workflow of file changes with git add . git commit steps for the files.
Push Changes to Your Downstream Remote Repository
When you are ready to push changes to your remote fork of the upstream repository, use the following:
$ git push origin feature-new-stuff
Your local and remote downstream repositories are now current with your local feature-new-stuff changes and this branch is current with the upstream repository changes as of the time of the merge step above.
After a long time i’m going to write a tut for you. Today i am just trying to explain you how you can build your web application using Yii2 PHP framework. We know that Yii2 is stand for ‘Yes it is’, by the help of this framework developer can build his/her web application easily without face any problem.
This is not only a framework, this is the real soul of php with quite good modifications.
Variables are very important part of any language, because variable store the value which define by user one time and by the help of variable you can call this value and also data types are very much important ,because it tells to compiler/ interpreter/encoder about variable type ; which helps to encoder/compiler to understand the value and its required bit/byte.