Giter Site home page Giter Site logo

Comments (7)

paulpdaniels avatar paulpdaniels commented on May 23, 2024 3

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 avatar mcohen75 commented on May 23, 2024 1

@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.

mcohen75 avatar mcohen75 commented on May 23, 2024

@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.

Superd22 avatar Superd22 commented on May 23, 2024

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.

mcohen75 avatar mcohen75 commented on May 23, 2024

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.

abernix avatar abernix commented on May 23, 2024

@mcohen75 Does https://github.com/apollographql/apollo-server/issues/2812 sound like it may parallel the ideas you're suggesting here?

from federation.

benkeil avatar benkeil commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.