How to use the ra-data-graphql.QUERY_TYPES.includes function in ra-data-graphql

To help you get started, we’ve selected a few ra-data-graphql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marmelab / react-admin / packages / ra-data-graphql-simple / src / buildGqlQuery.js View on Github external
args,
                        null,
                        gqlTypes.selectionSet([
                            gqlTypes.field(gqlTypes.name('id')),
                        ])
                    ),
                ]),
                gqlTypes.name(queryType.name),
                apolloArgs
            ),
        ]);
    }

    return gqlTypes.document([
        gqlTypes.operationDefinition(
            QUERY_TYPES.includes(aorFetchType) ? 'query' : 'mutation',
            gqlTypes.selectionSet([
                gqlTypes.field(
                    gqlTypes.name(queryType.name),
                    gqlTypes.name('data'),
                    args,
                    null,
                    gqlTypes.selectionSet(fields)
                ),
            ]),
            gqlTypes.name(queryType.name),
            apolloArgs
        ),
    ]);
};
github marmelab / react-admin / packages / ra-data-graphql-simple / src / queryBuilder.js View on Github external
},
        });
    }

    const query = {
        params: apolloArgs,
        fields: {
            data: {
                field: queryType.name,
                params: args,
                fields,
            },
        },
    };

    const result = QUERY_TYPES.includes(aorFetchType)
        ? encodeQuery(queryType.name, query)
        : encodeMutation(queryType.name, query);

    return result;
};
github marmelab / react-admin / packages / ra-data-graphcool / src / buildGqlQuery.js View on Github external
args,
                        null,
                        gqlTypes.selectionSet([
                            gqlTypes.field(gqlTypes.name('id')),
                        ])
                    ),
                ]),
                gqlTypes.name(queryType.name),
                apolloArgs
            ),
        ]);
    }

    return gqlTypes.document([
        gqlTypes.operationDefinition(
            QUERY_TYPES.includes(aorFetchType) ? 'query' : 'mutation',
            gqlTypes.selectionSet([
                gqlTypes.field(
                    gqlTypes.name(queryType.name),
                    gqlTypes.name('data'),
                    args,
                    null,
                    gqlTypes.selectionSet(fields)
                ),
            ]),
            gqlTypes.name(queryType.name),
            apolloArgs
        ),
    ]);
};
github Weakky / ra-data-opencrud / src / buildGqlQuery.ts View on Github external
alias: gqlTypes.name('data'),
            arguments: args,
            selectionSet: gqlTypes.selectionSet([
              gqlTypes.field(gqlTypes.name('id'))
            ])
          })
        ]),
        gqlTypes.name(queryType.name!),
        apolloArgs
      )
    ]);
  }

  return gqlTypes.document([
    gqlTypes.operationDefinition(
      QUERY_TYPES.includes(aorFetchType) ? 'query' : 'mutation',
      gqlTypes.selectionSet([
        gqlTypes.field(gqlTypes.name(queryType.name!), {
          alias: gqlTypes.name('data'),
          arguments: args,
          selectionSet: gqlTypes.selectionSet(fields)
        })
      ]),
      gqlTypes.name(queryType.name!),
      apolloArgs
    )
  ]);
};
github marmelab / react-admin / packages / ra-data-graphcool / src / queryBuilder.js View on Github external
},
        });
    }

    const query = {
        params: apolloArgs,
        fields: {
            data: {
                field: queryType.name,
                params: args,
                fields,
            },
        },
    };

    const result = QUERY_TYPES.includes(aorFetchType)
        ? encodeQuery(queryType.name, query)
        : encodeMutation(queryType.name, query);

    return result;
};

ra-data-graphql

A GraphQL data provider for react-admin

MIT
Latest version published 8 days ago

Package Health Score

93 / 100
Full package analysis

Popular ra-data-graphql functions