Comments (7)
Introduce a new directive to mark fields and types as private.
directive @Private on FIELD_DEFINITION | OBJECT
Was going to open an issue, glad I searched first. I just ran into this issue as well and would like the ability to selectively declare certain fields as private (or scoped) such that we can use them when talking across service boundaries but remain hidden from introspection and external use.
from federation.
@mcohen75 Does apollographql/apollo-server#2812 sound like it may parallel the ideas you're suggesting here?
Yes, it does. One key difference here is that I've proposed that the same directive should apply to types as well. This will enable nesting to avoid muddling a type with parameters that are out of place.
from federation.
@trevor-scheer @abernix I'm interested in hearing your thoughts about something like this. I'm willing to help implement this if it's a direction that you think makes sense.
from federation.
Just fyi, I was under the impression that this was on the roadmap in the form of an Internal
directive. but cannot find any mention of it besides that comment
from federation.
Thanks @Superd22 for referencing that comment! I haven't been following the federation-demo project so was not aware of these plans. Hopefully this issue will serve as a useful place to discuss this feature.
from federation.
@mcohen75 Does https://github.com/apollographql/apollo-server/issues/2812 sound like it may parallel the ideas you're suggesting here?
from federation.
You could solve this with a workaround. Given the channel API returns an accountRef
field you can do:
Schema:
type Account {
id: String
}
type Channel {
account: Account
}
The account Field resolver in the channel resolver:
export const account = (parent: Channel & { accountRef: string }, _: any, context: Context): Account => (
{
id: parent.accountRef,
}
);
from federation.
Related Issues (20)
- Build Plan failure when using fragments and @include
- How to apply alias in @key field in apollo federation HOT 1
- printSubgraphSchema fails if using a schema transformer and extending an external type
- subgraph-js: directive can't be used on custom scalar definition
- Support for referencing @interfaceObject without contributing a field
- An alternative to reuseFragments
- ComposeDirective should be added to the apiSchema as well as the supergraph schema. HOT 2
- Do not depend on Elastic License 2.0 packages in @apollo/subgraph HOT 1
- Odd composition behavior with shareable + override
- auto-upgraded schemas get upgraded to latest federation version.
- @interfaceObject example doesn't work HOT 2
- Interface type explosion causes error on query HOT 3
- Unable to add an interface extending an entity interface without breaking dependent subgraphs
- Enable `@requires` on root Query types or error on using on root query types
- Query planner bug with queries fetching fields nested in multiple unions HOT 1
- Can't resolve 'console' in NextJS HOT 1
- Gateway will merge incorrect data if subgraph changes entity order HOT 1
- Query planner generates invalid fetch node selection sets when reuseQueryFragments=true HOT 2
- Directives on `QUERY`, `MUTATION`, or `SUBSCRIPTION` are not passed to subgraphs HOT 2
- Allow reference to field without optional arguments in @external definition HOT 1
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 federation.