You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/blog/20160419-mocking.md
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,15 @@ date: 19 Apr 2016
6
6
byline: "Jonas Helfer"
7
7
guestBio: engineer at Meteor working on Apollo
8
8
---
9
+
9
10
Do you think mocking your backend is always a tedious task? If you do, reading this post might change your mind…
10
11
11
12
Mocking is the practice of creating a fake version of a component, so that you can develop and test other parts of your application independently. Mocking your backend is a great way to quickly build a prototype of your frontend, and it lets you test your frontend without starting up any servers. API mocking is so useful that a [quick Google search](https://www.google.com/?ion=1&espv=2#q=mock+rest+api) will turn up dozens of expensive products and services that promise to help you.
12
13
13
14
Sadly, I think none of the solutions out there make it as easy as it should be. As it turns out, that’s because they’ve been trying to do it with the wrong technology!
14
15
16
+
> Editor’s note : The concepts in this post are accurate, but some the code samples don’t demonstrate new usage patterns. After reading, consult the [graphql-tools docs](http://dev.apollodata.com/tools/graphql-tools/mocking.html) to see how to use mocking today.
17
+
15
18
## Why mock?
16
19
17
20
Mocking the data a backend would return is very useful for two main reasons:
@@ -68,12 +71,12 @@ But enough talking, here’s a complete example:
To see the example in action and see what output it generates, head over to the [live demo](https://apollostack.github.io/mock-demo/) and click the “play” button a couple of times!
74
+
To see the example in action and see what output it generates, head over to the [live demo](https://launchpad.graphql.com/98lq7vz8r) try running some queries!
72
75
73
-
If you want to fiddle around with the example, you can do that — it’s all on GitHub: [apollostack/mock-demo](https://github.com/apollostack/mock-demo). If you’re curious about how it works or want to see what other tools we’re building for GraphQL, then head over to [apollostack/graphql-tools](https://github.com/apollostack/graphql-tools).
76
+
If you want to fiddle around with the example, just click the "Download" button in the Launchpad UI. If you’re curious about how it works or want to see what other tools we’re building for GraphQL, then head over to [apollostack/graphql-tools](https://github.com/apollostack/graphql-tools).
74
77
75
78
Pretty cool, right? All of that becomes possible by using a type system. And that’s only just the beginning — we‘re working on bridging the gap between mocking and the real thing so that your mock server can gradually turn into your real server as you add more functionality to it.
76
79
77
80
- - -
78
81
79
-
*This post was originally published on [Building Apollo](https://medium.com/apollo-stack), a blog where Sashko Stubailo and myself write about building a futuristic GraphQL-based data stack called [Apollo](http://www.apollostack.com). We publish one or two posts every week, about the stuff we’re working on and thinking about.*
82
+
*This post was originally published on [the Apollo Blog](https://medium.com/apollo-stack). We publish one or two posts every week, about the stuff we’re working on and thinking about.*
In this talk, we'll discuss the history and purpose of GraphQL, common misconceptions about GraphQL, and setting up GraphQL in a Node/Express back-end. We'll also take a look at GraphQL's development tool GraphiQL and how it self-documents your resources. If you're curious about GraphQL and how to make working with relational data a breeze, join us!
18
+
19
+
## Past Events
20
+
11
21
### GraphQL-Europe Conference
12
22
13
23
-**Date:** 21st May, 2017
@@ -51,3 +61,4 @@ Everyone is excited about Subscriptions, the new real-time GraphQL feature. Curi
51
61
### Asia
52
62
53
63
-[GraphQL Tel Aviv](https://www.meetup.com/GraphQL-TLV/)
0 commit comments