I see many people getting confused why GraphQL doesn't have a wildcard field; in fact I see some people calling GraphQL "half baked" and seeing the lack of wildcard as one of the reasons that justify their opinion.
I think this topic should be added to the FAQ. I wasn't comfortable adding a PR to proposals as it's not clear exactly what format the proposal should be in yet (they seem to be placeholders currently?).
IMO the lack of a wildcard field is one of GraphQL's biggest strengths - it forces clients to specify the fields that they need, which has a number of advantages:
- it reduces back-end load, as less data needs to be calculated
- it reduces bandwidth, as no unused data is transferred (no over-fetching)
- most importantly, it enables the schema to be maintained in a versionless way - adding new fields to a type will not affect any existing queries, and we can determine which fields are being used so we know when we can safely remove deprecated fields (should we wish to do so)
Here's a massive conversation about this in the spec repo:
I see many people getting confused why GraphQL doesn't have a wildcard field; in fact I see some people calling GraphQL "half baked" and seeing the lack of wildcard as one of the reasons that justify their opinion.
I think this topic should be added to the FAQ. I wasn't comfortable adding a PR to proposals as it's not clear exactly what format the proposal should be in yet (they seem to be placeholders currently?).
IMO the lack of a wildcard field is one of GraphQL's biggest strengths - it forces clients to specify the fields that they need, which has a number of advantages:
Here's a massive conversation about this in the spec repo: