Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

84
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda