GraphQL Server
-
Single Point of Opportunities
Tobias Meixner @ GraphQL Day Bodensee
www.brikl.io
3 Facts
Vivid Twitter
Reader &
Retweeter
German citizen prev.
ice speed skater
& a lot of engineers...
Let's talk GraphQL!
GraphQL
Bangkok
GraphQL
Asia
GraphQL
Hong Kong
GraphQL Servers
The good, the bad and the?
SWOT for GraphQL
Strengths are internal,
positive attributes of
your company. These
are things that are
within your control.
Strength
Weaknesses are
negative factors that
detract from your
strengths. These are
things that you might
need to improve on to
be competitive.
Weakness
Opportunities are
external factors in your
business environment
that are likely to
contribute to your
success.
Opportunity
Threats are external
factors that you have
no control over. You
may want to consider
putting in place
contingency plans for
dealing them if they
occur.
Threat
Note!
Baised towards
GraphQL
Not scientific Mostly JS related
Strength
What is good about GraphQL Servers?
Empower the client/frontend
Contract between frontend and backend
Client will define shape of data rather than
backend
High developer velocity
Data-driven development helps to speed up
frontend development significantly
Optimized fetching
Reduce network round-trips
Reduce payload size
Strength
Weakness
What are the negative sides of
using GraphQL Servers?
High learning curve
Can be overwhelming to get started as a new
technology
N+1
Overzealous database calls and waste of
resources with duplicate requests
Caching
Challenging to achieve on the gateway level due
to complexity and variety of client requests
Weakness
Threats
What poses a danger using GraphQL?
Missing eco-system
GraphQL great for internal development but not
as public API just yet
Ethical implications
Consider the effect of picking GraphQL and a
vendor
Vendor-lock in
Hard to combine or have GraphQL vendors to
interact - danger of locked-in
Threats
Opportunity
What can you achieve with GraphQL?
Type-Safety
GraphQL Schema as universal type definition in
client and server side
Growing community
Getting larger by the day
Great developer experience
Fantastic experience especially for frontend
developers
Opportunity
What can you do
with GraphQL?
End-To-End Testing
Full end-to-end testing using benefits of frontend - backend
contract - refer to the talk of Robert Dickert:
https://www.youtube.com/watch?v=3Bpdh5j05r8
Testing
Resolve types in
mutations
Use mutation payloads to perform integration testing
Replace refetch
You can replace refetch using returning types updating
your normalized cache
Payload
as cache
update
Return meta data Use mutation payloads to return meta data, error handling
Payload
and
error
handling
Return meta data Use mutation payloads to return meta data, error handling
Payload and error handling
Insights
Tracing
Get fine grained insights on usages in your apps for client
usage, query metrics and its traces
Tracing of
fields and
type
resolvers
Powerful insights
Beyond tracing time
Complexity Payload size Query history
Public facing APIs could charge customers by actual usage based on complexity of a GraphQL query rather than charging by no. of API calls
Fine-grained tracing also enables highly personalized results or usage profiles by user
Auto-
Indexing
Adjust to the
client needs and
preferences
Knowing request patterns and tracing down to the field
level you are able to index and adjust usage down to the
data layer.
Single point of
opportunity
but...
Over-
ambitious
GraphQL
GraphQL as Gateway
https://medium.com/@__xuorig__/the-rise-of-
graphql-overambitious-api-gateways-
2c6f054e80a1
Example 1:
Authorization
Authenticate in the gateway
Authorize in the service
e
Don't sell or try to
use GraphQL as
silver bullet
Be mindful of
GraphQL
weaknesses
Use an opinionated
GQL server if it fits
your use-case
Thank you!
meixnertobias

GraphQL Server - Single point of opportunities