Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

87
Visualizações
AWS graphql modeling

I have following schema

type Community
  @model
  @auth(rules: [{ allow: owner }, { allow: groups, groups: ["AdminRoot"] }]) {
  id: ID!
  name: String
  users: [User] @manyToMany(relationName: "UserCommunity")
  owner: ID!
  rootAdmin: User @hasOne(fields: ["owner"])
}

type User
  @model
  @auth(
    rules: [
      { allow: owner, ownerField: "id", operations: [read, update] }
      { allow: groups, groups: ["AdminRoot"] }
      { allow: public, provider: apiKey, operations: [create] }
    ]
  ) {
  id: ID!
  name: String
  identityId: String
  communities: [Community] @manyToMany(relationName: "UserCommunity")
}

My problem is when i when i do this query

    query ListCommunities(
      $filter: ModelCommunityFilterInput
      $limit: Int
      $nextToken: String
    ) {
      listCommunities(
        filter: $filter
        limit: $limit
        nextToken: $nextToken
      ) {
        items {
          id
          name
        }
      }
    }

It displays me all the communities where i am the owner.

But i want to display me all the coummunities also the one where i am not the owner but just a User under users

How do i do this? Do i need a lambda? Or with appsync VTL ?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda