Comments (7)
The problem is that after reading this section there is no example or other hint on the shape in which the operation's name should be specified or where to look up the spec. It would be nice to be pointed to somewhere in this section.
Good point, @martinheidegger. Would you like to submit a PR that adds a (probably small) example?
from graphql.github.io.
Operation name is a "cosmetic" name for this particular query, much like a function name in JavaScript. So:
{ me { username }}
Is like an anonymous function:
(function () {
console.log('hello');
})()
Here's a query with an operation name:
query MeQuery {
me { username }
}
That's like a named function:
function printGreeting() {
console.log('hello');
}
printGreeting();
Basically it's a string you can use to refer to that function in your code, developer tools, logs, stack traces etc.
One of the most useful uses for it is in your server-side logging you can use that name to identify which queries take a long time, instead of having to look at the entire query string.
from graphql.github.io.
I guess a bug in GraphiQL?
Sounds like it could be. If you can still repro on the latest release (0.9.1), please report it over on the GraphiQL issues page.
from graphql.github.io.
I agree with this - that section introduces a lot of new concepts at the same time and should probably do that incrementally.
from graphql.github.io.
@wincent Sorry, but I havn't figured out how it is supposed to work yet.
from graphql.github.io.
@stubailo a funny thing I ran into just now that's confusing m noob brain:
when I don't use "query" as in "query { ... " and instead use just "{ ... " GraphiQL returns an error saying it "Unknown operation named "null""
If I use "query { ..." it works just fine, but if I then remove "query" and re-evaluate it works, too, but not after I refresh the GraphiQL page (then it requires 'query' qualifier again or it produces the aforementioned error.
I guess a bug in GraphiQL?
from graphql.github.io.
By the way, I wrote a post about this recently: https://dev-blog.apollodata.com/the-anatomy-of-a-graphql-query-6dffa9e9e747
If someone has time, please send some PRs to GraphQL.org with content lifted from that post!
from graphql.github.io.
Related Issues (20)
- Buttons on the partners page of the conf website aren't responsive
- Adding "Brangr" client/browser to the Code page? HOT 4
- Edit this page button takes to github.com and to this repo HOT 3
- Support for Dark theme ? HOT 1
- `StarWarsSchema` type descriptions are `null` in Introspection docs
- "Edit this page" link on FAQ page goes to `github.com/faq` HOT 2
- Clarification on "Schemas and Types" documentation
- Remove the "GraphQL Conf 2023" registration banner
- Feature request for GitHub GraphQL? HOT 1
- npm and GitHub stars/downloads show as 0 for all tools HOT 1
- Add link to store.graphql.org HOT 4
- Updated docs to reflect express-graphql deprecation HOT 3
- Query editors don't have visible scrollbars
- /swapi-graphql is broken again HOT 6
- [Discussion] Getting Started experience on graphql.org HOT 3
- Explain a bit more what Ruru is? HOT 1
- [Improvement request]: Segregate GraphGL standard implementation features from GraphGL extensions
- Landscape iframe busted on https://graphql.org/users/ HOT 2
- Clarify that some of the meetings on the calendar are not open to the public
- [Question] Sample code for GraphQL.js tutorial HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql.github.io.