Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GQL query for <missing>

When you change data models on the app engine to add new properties those entries without a certain property are listed with the value <missing> in the online data viewer.

What I'm wondering is how can I write a query to find those entries?

like image 216
Swizec Teller Avatar asked Sep 06 '10 15:09

Swizec Teller


People also ask

What is query in GQL?

A GraphQL query is used to read or fetch values while a mutation is used to write or post values. In either case, the operation is a simple string that a GraphQL server can parse and respond to with data in a specific format. The popular response format that is usually used for mobile and web applications is JSON.

How do I get data from a GraphQL query?

You can fetch data very simply with the help of the package graphql-request . GraphQL Request is a library that doesn't require you to set up a client or a Provider component. It is essentially a function that just accepts an endpoint and a query.

What is Gql in Apollo server?

apollo-server is the core library for Apollo Server itself, which helps you define the shape of your data and how to fetch it. graphql is the library used to build a GraphQL schema and execute queries against it.

What is schema Gql?

Your GraphQL server uses a schema to describe the shape of your available data. This schema defines a hierarchy of types with fields that are populated from your back-end data stores. The schema also specifies exactly which queries and mutations are available for clients to execute.


2 Answers

There is no direct way to query for older entities with missing attribute, but you can design data model upfront to support this. Add a version attribute to each model class. Version should have a default value, which is increased every time model class is changed and deployed. This way you will be able to query entities by version number.

like image 109
Constantin Avatar answered Sep 24 '22 06:09

Constantin


There's no way to query the datastore for entities that don't have a given property. You need to iterate over all the entities and check each one - possibly by using the mapreduce API.

like image 34
Nick Johnson Avatar answered Sep 23 '22 06:09

Nick Johnson