System Information
- Strapi Version: 3.4.1.
- Operating System: MacOS
- Database: PostgresQL
- Node Version:
- NPM Version:
- Yarn Version:
Hi guyes, I am using the Rest-API but want to have strong typing while using Typescript.
Therefore, I configured codegen to automatically create types for me asking the graphql-api what types are available. But somehow, this creates multiple types for one content type.
Example:
export type Global = {
__typename?: 'Global';
id: Scalars['ID'];
created_at: Scalars['DateTime'];
updated_at: Scalars['DateTime'];
favicon?: Maybe<UploadFile>;
footer?: Maybe<ComponentMoleculesFooter>;
navbar?: Maybe<ComponentMoleculesNavbar>;
globalMetadata?: Maybe<ComponentMetaMetadata>;
personalData?: Maybe<ComponentMetaPersonalData>;
};
export type GlobalInput = {
favicon?: Maybe<Scalars['ID']>;
footer?: Maybe<ComponentMoleculesFooterInput>;
navbar?: Maybe<ComponentMoleculesNavbarInput>;
globalMetadata?: Maybe<ComponentMetaMetadatumInput>;
personalData?: Maybe<ComponentMetaPersonalDatumInput>;
created_by?: Maybe<Scalars['ID']>;
updated_by?: Maybe<Scalars['ID']>;
};
export type EditGlobalInput = {
favicon?: Maybe<Scalars['ID']>;
footer?: Maybe<EditComponentMoleculesFooterInput>;
navbar?: Maybe<EditComponentMoleculesNavbarInput>;
globalMetadata?: Maybe<EditComponentMetaMetadatumInput>;
personalData?: Maybe<EditComponentMetaPersonalDatumInput>;
created_by?: Maybe<Scalars['ID']>;
updated_by?: Maybe<Scalars['ID']>;
};
Now, I want to get rid of the Maybe wrappers around everything, but when I set fields to ‘required’ in the admin console or in the json-representations of the types in my backend, this only changes the e.g. “GlobalInput” type and not the actual “Global” type…
Is this supposed to actually be like this??
If yes: Can somebody help me figuring out how to get the actual content types with ‘required’ fields working to get rid of all this Maybe-stuff ??
Appreciate all your efforts to help