Files
smart-city-digital-twin-mar…/smart-app-city/frontend/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs
Eric FELIXINE e30ae8ed09 feat(smart-app): implement complete mobile app MVP
- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
2026-06-01 18:00:35 -04:00

69 lines
3.2 KiB
JavaScript

import invariant from "../../../jsutils/invariant.mjs";
import { GraphQLError } from "../../../error/GraphQLError.mjs";
import { getNamedType, isInputObjectType } from "../../../type/definition.mjs";
/**
* No deprecated
*
* A GraphQL document is only valid if all selected fields and all used enum values have not been
* deprecated.
*
* Note: This rule is optional and is not part of the Validation section of the GraphQL
* Specification. The main purpose of this rule is detection of deprecated usages and not
* necessarily to forbid their use when querying a service.
*/
export function NoDeprecatedCustomRule(context) {
return {
Field: function Field(node) {
var fieldDef = context.getFieldDef();
var deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason;
if (fieldDef && deprecationReason != null) {
var parentType = context.getParentType();
parentType != null || invariant(0);
context.reportError(new GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated. ").concat(deprecationReason), node));
}
},
Argument: function Argument(node) {
var argDef = context.getArgument();
var deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason;
if (argDef && deprecationReason != null) {
var directiveDef = context.getDirective();
if (directiveDef != null) {
context.reportError(new GraphQLError("Directive \"@".concat(directiveDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node));
} else {
var parentType = context.getParentType();
var fieldDef = context.getFieldDef();
parentType != null && fieldDef != null || invariant(0);
context.reportError(new GraphQLError("Field \"".concat(parentType.name, ".").concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node));
}
}
},
ObjectField: function ObjectField(node) {
var inputObjectDef = getNamedType(context.getParentInputType());
if (isInputObjectType(inputObjectDef)) {
var inputFieldDef = inputObjectDef.getFields()[node.name.value]; // flowlint-next-line unnecessary-optional-chain:off
var deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason;
if (deprecationReason != null) {
context.reportError(new GraphQLError("The input field ".concat(inputObjectDef.name, ".").concat(inputFieldDef.name, " is deprecated. ").concat(deprecationReason), node));
}
}
},
EnumValue: function EnumValue(node) {
var enumValueDef = context.getEnumValue();
var deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason;
if (enumValueDef && deprecationReason != null) {
var enumTypeDef = getNamedType(context.getInputType());
enumTypeDef != null || invariant(0);
context.reportError(new GraphQLError("The enum value \"".concat(enumTypeDef.name, ".").concat(enumValueDef.name, "\" is deprecated. ").concat(deprecationReason), node));
}
}
};
}